forked from jxmorris12/language_tool_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_local.bash
More file actions
executable file
·29 lines (21 loc) · 1.02 KB
/
Copy pathtest_local.bash
File metadata and controls
executable file
·29 lines (21 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
#
# Test command-line usage.
set -ex
trap "echo -e '\x1b[01;31mFailed\x1b[0m'" ERR
exit_status=0
echo 'This is okay.' | python -m language_tool_python - || exit_status=1
echo 'This is noot okay.' | python -m language_tool_python - && exit_status=1
echo 'This is okay.' | python -m language_tool_python - || exit_status=1
echo 'This is noot okay.' | python -m language_tool_python - && exit_status=1
echo 'These are “smart” quotes.' | python -m language_tool_python - || exit_status=1
echo 'These are "dumb" quotes.' | python -m language_tool_python - && exit_status=1
echo 'These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
--enable=EN_QUOTES - && exit_status=1
echo 'These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
--enable=EN_UNPAIRED_BRACKETS - || exit_status=1
echo '# These are "dumb".' | python -m language_tool_python --ignore-lines='^#' - || exit_status=1
if [[ "$exit_status" == 0 ]]; then
echo -e '\x1b[01;32mOkay\x1b[0m'
fi
exit "$exit_status"