From e5c58d5fc502ef835b5c1655a43a097d87de1d40 Mon Sep 17 00:00:00 2001 From: Jacob Signorovitch Date: Mon, 3 Feb 2025 13:02:28 -0500 Subject: [PATCH] Fixed tests. Can't have spaces for some reason. Not a real fix. --- test/val/test.bats | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/test/val/test.bats b/test/val/test.bats index d53021d..e54d287 100644 --- a/test/val/test.bats +++ b/test/val/test.bats @@ -84,25 +84,26 @@ bin() { ./scl.out $1 | tail -n1; } [ "$output" = "= 9.000000" ] } -#@test "basic blocks" { -# run bin "{ 1 }" -# [ "$output" = "= 1.000000" ] -# -# run bin "2 + { 3; 4 }" -# [ "$output" = "= 6.000000" ] -# -# run bin "5 * { 1 + 1; 5 * 2 }" -# [ "$output" = "50.000000" ] -#} +@test "basic blocks" { + run bin "{1}" + [ "$output" = "= 1.000000" ] + + run bin "2+{3;4}" + [ "$output" = "= 6.000000" ] + + run bin "5*{1+1;5*2}" + echo $output + [ "$output" = "= 50.000000" ] +} + +@test "variable definition" { + run bin "x=1" + [ "$output" = "= 1.000000" ] -#@test "variable definition" { -# run bin "x = 1" -# [ "$output" = "= 1.000000" ] -# # run bin "x = 1; x + 1" # [ "$output" = "= 2.000000" ] -#} -# +} + #@test "function definition" { # run bin "f(n)=2*n; f(2)" # [ "$output" = "= 4.000000" ]