Skip to content

Commit

Permalink
tests: remove trailing whitespaces from .expected files
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFola committed Jun 15, 2024
1 parent b98a8dc commit b3ed84e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
1 change: 1 addition & 0 deletions tests/errors/compiler/invalid_escape_seq.expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
In file ./compiler/invalid_escape_seq.ark
At \ @ 1:9
1 | (print "\0")
| ^
Expand Down
2 changes: 1 addition & 1 deletion tests/errors/index/at_out_of_range.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
IndexError: -2 out of range \[1\] (length 1)
IndexError: -2 out of range [1] (length 1)
3 changes: 2 additions & 1 deletion tests/errors/macros/argcount_unknown_arg.expected
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
In file ./macros/argcount_unknown_arg.ark
At test_func1!2 @ 13:41
10 |
11 | (let test_func (fun (a b c) (* a b c)))
12 | (let test_func1 (partial test_func 1))
13 | (let test_func1_2 (partial test_func1!2))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 |
When expanding `argcount', expected a known function name, got unbound variable test_func1!2%
When expanding `argcount', expected a known function name, got unbound variable test_func1!2
23 changes: 12 additions & 11 deletions tests/errors/run-tests
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,32 @@ else
fi

Reset='\033[0m'
Black='\033[0;30m'
Red='\033[0;31m'
Green='\033[0;32m'
Yellow='\033[0;33m'
Blue='\033[0;34m'
Purple='\033[0;35m'
Cyan='\033[0;36m'
White='\033[0;37m'

passed=0
failed=0

for f in ./**/*.ark; do
output=$($ark $f --lib ../../lib 2>&1)
expected=$(cat ${f%.*}.expected)
output=$($ark "$f" --lib ../../lib 2>&1)
expected=$(cat "${f%.*}.expected")

if [[ $(echo $output | grep "$expected") == "" ]]; then
case "$output" in
*"$expected"* )
echo -e "${Green}PASSED${Reset} ${f%.*}"
((passed=passed+1))
;;

*)
echo -e "${Red}FAILED${Reset} ${f%.*}"
((failed=failed+1))
echo -e " ${Yellow}Output${Reset}:"
echo $output
else
echo -e "${Green}PASSED${Reset} ${f%.*}"
((passed=passed+1))
fi
diff -a -y <(echo -e "$output") <(echo -e "$expected")
;;
esac
done

echo " ------------------------------"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
In file tests/unittests/resources/ParserSuite/failure/incomplete_if.ark
At EOF @ 2:0
1 | (if 1 2 3
2 |
2 |
| ^
Missing ')' after condition
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ In file tests/unittests/resources/ParserSuite/failure/invalid.ark
At ) @ 1:10
1 | (print 1))
| ^
2 |
2 |
invalid syntax, expected node

0 comments on commit b3ed84e

Please sign in to comment.