Skip to content

Commit 3b1affe

Browse files
authored
Merge pull request jxmorris12#34 from aokellermann/bug/FixBashTests
Fix Bash Tests
2 parents 058849f + 8e72fcd commit 3b1affe

2 files changed

Lines changed: 23 additions & 14 deletions

File tree

‎tests/test_local.bash‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ set -ex
66

77
trap "echo -e '\x1b[01;31mFailed\x1b[0m'" ERR
88

9-
echo 'This is okay.' | python -m language_tool_python -
10-
! echo 'This is noot okay.' | python -m language_tool_python -
9+
exit_status=0
1110

12-
echo 'This is okay.' | python -m language_tool_python -
13-
! echo 'This is noot okay.' | python -m language_tool_python -
11+
echo 'This is okay.' | python -m language_tool_python - || exit_status=1
12+
echo 'This is noot okay.' | python -m language_tool_python - && exit_status=1
1413

15-
echo 'These are “smart” quotes.' | python -m language_tool_python -
16-
! echo 'These are "dumb" quotes.' | python -m language_tool_python -
17-
! echo 'These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
18-
--enable=EN_QUOTES -
14+
echo 'This is okay.' | python -m language_tool_python - || exit_status=1
15+
echo 'This is noot okay.' | python -m language_tool_python - && exit_status=1
16+
17+
echo 'These are “smart” quotes.' | python -m language_tool_python - || exit_status=1
18+
echo 'These are "dumb" quotes.' | python -m language_tool_python - && exit_status=1
19+
echo 'These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
20+
--enable=EN_QUOTES - && exit_status=1
1921
echo 'These are "dumb" quotes.' | python -m language_tool_python --enabled-only \
20-
--enable=EN_UNPAIRED_BRACKETS -
22+
--enable=EN_UNPAIRED_BRACKETS - || exit_status=1
2123

22-
echo '# These are "dumb".' | python -m language_tool_python --ignore-lines='^#' -
24+
echo '# These are "dumb".' | python -m language_tool_python --ignore-lines='^#' - || exit_status=1
2325

24-
echo -e '\x1b[01;32mOkay\x1b[0m'
26+
if [[ "$exit_status" == 0 ]]; then
27+
echo -e '\x1b[01;32mOkay\x1b[0m'
28+
fi
29+
exit "$exit_status"

‎tests/test_remote.bash‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@ clean ()
1616
}
1717
trap clean EXIT
1818

19+
exit_status=0
20+
1921
echo 'This is okay.' | \
20-
python -m language_tool_python --remote-host localhost --remote-port "$port" -
22+
python -m language_tool_python --remote-host localhost --remote-port "$port" - || exit_status=1
23+
24+
echo 'This is noot okay.' | \
25+
python -m language_tool_python --remote-host localhost --remote-port "$port" - && exit_status=1
2126

22-
! echo 'This is noot okay.' | \
23-
python -m language_tool_python --remote-host localhost --remote-port "$port" -
27+
exit "$exit_status"

0 commit comments

Comments
 (0)