-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from kaeluka/failing-tests
Make failing tests possible, improve test output.
- Loading branch information
Showing
3 changed files
with
54 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
STDIN=$(cat) | ||
|
||
function FAIL { | ||
MSG=$1 | ||
echo "ERROR: $1" | ||
exit 1 | ||
} | ||
|
||
# Requires that an error was reported in a specific line | ||
function error_at { | ||
LINE=$1 | ||
(echo "$STDIN" | grep -A1 "(line $LINE, column" > /dev/null) || FAIL "expected error on line $LINE" | ||
} | ||
|
||
# Requires that an error was reported with a specific message | ||
function error_msg { | ||
MSG=$1 | ||
(echo "$STDIN" | grep "$MSG" > /dev/null) || FAIL "expected error with message '$MSG'" | ||
} |