Show output for assert_line() and refure_line()

Required for diagnostics
This commit is contained in:
Ivan Pozdeev 2022-04-26 15:23:30 +03:00
parent 864cd79980
commit 32a86a84c0

View file

@ -84,7 +84,8 @@ assert_line() {
for line in "${lines[@]}"; do for line in "${lines[@]}"; do
if [ "$line" = "$1" ]; then return 0; fi if [ "$line" = "$1" ]; then return 0; fi
done done
flunk "expected line \`$1'" flunk "expected line \`$1'" $'\n'\
"output: $output"
fi fi
} }
@ -98,7 +99,8 @@ refute_line() {
local line local line
for line in "${lines[@]}"; do for line in "${lines[@]}"; do
if [ "$line" = "$1" ]; then if [ "$line" = "$1" ]; then
flunk "expected to not find line \`$line'" flunk "expected to not find line \`$line'" $'\n'\
"output: $output"
fi fi
done done
fi fi