summaryrefslogtreecommitdiff
path: root/testing.sh
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-06-17 06:53:27 +0200
committerkdx <kikoodx@paranoici.org>2023-06-17 06:53:27 +0200
commit04f2e54f7eac3bde22ccb6085bdd7663b125b16a (patch)
tree6ad4ff23af8f7433f5afb31cb39e1cf16708004e /testing.sh
parent9cc55f4c51903afbf46a2fbe7725d9aa855f795d (diff)
downloadgolem-04f2e54f7eac3bde22ccb6085bdd7663b125b16a.tar.gz
multidec
Diffstat (limited to 'testing.sh')
-rwxr-xr-xtesting.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/testing.sh b/testing.sh
index 21f28ec..c8f4ad3 100755
--- a/testing.sh
+++ b/testing.sh
@@ -19,7 +19,7 @@ test "$1" "main() {'a' - 'b';}"
test "$1" "main() { buzz(); } buzz() { return 42; }"
test "$1" "main() { fizz(50 + buzz() - 3) * 4; } fizz() { return 3; } buzz() { return 42; }"
test "$1" "global abc; main(){ return abc; }"
-test "$1" "global abc = 5; main() { return abc; }"
+test "$1" "global abc = 5; main() { dbg abc; return abc; }"
test "$1" "main() { return abc; } global abc = 5;"
test "$1" "global abc = 5; main(){ inc(); return abc; } inc() { abc = abc + 1; }"
test "$1" "main() { wrt('H'); wrt('e'); wrt('l'); wrt('l'); wrt('o'); wrt('!'); wrt('\n'); }"
@@ -61,4 +61,7 @@ test "$1" "main() { wrt inc('0') |> dec() |> inc() |> inc(); wrt '\n'; } inc(a)
test "$1" "main();"
test "$1" "main() {}"
test "$1" "main() {;;;;;;;;;;;;;;;;;}"
+test "$1" "global a = 8, b, c = 4; main() { dbg a; dbg c; }"
+test "$1" "global a, b = 6, c = 4; main() { dbg b; dbg c; }"
+test "$1" "main() { local a = 5, b = 7, c; dbg a; dbg b; }"
rm -f build/tmp.*