From 254563f7591c4c67f5f03ef082e0e8b6da297780 Mon Sep 17 00:00:00 2001 From: Akuli Date: Sat, 16 Dec 2023 20:36:39 +0200 Subject: [PATCH] Test source file with zero byte --- runtests.sh | 6 +++--- .../other_errors/source_file_contain_zero_byte.jou | Bin 0 -> 45 bytes 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 tests/other_errors/source_file_contain_zero_byte.jou diff --git a/runtests.sh b/runtests.sh index 8d72a95b..1c8adc9d 100755 --- a/runtests.sh +++ b/runtests.sh @@ -101,9 +101,9 @@ function generate_expected_output() echo "A lot of output hidden..." else ( - (grep -onH '# Warning: .*' $joufile || true) | sed -E s/'(.*):([0-9]*):# Warning: '/'compiler warning for file "\1", line \2: '/ - (grep -onH '# Error: .*' $joufile || true) | sed -E s/'(.*):([0-9]*):# Error: '/'compiler error in file "\1", line \2: '/ - (grep -oE '# Output:.*' $joufile || true) | sed -E s/'^# Output: ?'// + (grep --binary-files=text -onH '# Warning: .*' $joufile || true) | sed -E s/'(.*):([0-9]*):# Warning: '/'compiler warning for file "\1", line \2: '/ + (grep --binary-files=text -onH '# Error: .*' $joufile || true) | sed -E s/'(.*):([0-9]*):# Error: '/'compiler error in file "\1", line \2: '/ + (grep --binary-files=text -oE '# Output:.*' $joufile || true) | sed -E s/'^# Output: ?'// ) | sed "s,,$joudir,g" | sed "s,,$jouexe,g" fi echo "Exit code: $correct_exit_code" diff --git a/tests/other_errors/source_file_contain_zero_byte.jou b/tests/other_errors/source_file_contain_zero_byte.jou new file mode 100644 index 0000000000000000000000000000000000000000..e29ffbcbf91a34b976ac007232f5ebb06b4cbb82 GIT binary patch literal 45 zcmZQjP*7HIEh@?{vQj9{FD*(=RY=RsNmWSB&nrpH%qvz%RH#ZV%2!CLEJ@`807J+Q A_W%F@ literal 0 HcmV?d00001