2 # Copyright 2018 by Denys Vlasenko
3 # Licensed under GPLv2 or later, see file LICENSE in this source tree.
7 # testing "test name" "command" "expected result" "file input" "stdin"
9 testing "bc comment 1" \
12 "" "1 /* comment */ + 2"
14 testing "bc comment 2: /*/ is not a closed comment" \
19 testing "bc backslash 1" \
24 testing "bc string 1" \
29 testing "bc if 0 else" \
32 "" "if (0) 1 else 2; 9"
34 testing "bc if 1 else" \
37 "" "if (1) 1 else 2; 9"
39 testing "bc if 1 if 1 else else" \
42 "" "if (1) if (1) 1 else 2 else 3; 9"
44 testing "bc if 0 else if 1" \
47 "" "if (0) 1 else if (1) 2; 9"
49 tar xJf bc_large.tar.xz
52 r="`basename "$f" .bc`_results.txt"
53 test -f "$r" || continue
54 # testing "test name" "command" "expected result" "file input" "stdin"
56 "{ { bc -lq $f 2>&1; echo E:\$? >&2; } | diff -u - $r; echo E:\$?; } 2>&1" \