Improved test descriptions

This commit is contained in:
2025-04-15 11:51:03 +02:00
parent 80aa833a9b
commit 392b35423f

View File

@ -72,6 +72,9 @@ func TestParse(t *testing.T) {
{"Unary minus 6", "a + -b", "(+ a (- b))"}, {"Unary minus 6", "a + -b", "(+ a (- b))"},
{"Unary minus 7", "-a + -b", "(+ (- a) (- b))"}, {"Unary minus 7", "-a + -b", "(+ (- a) (- b))"},
{"Assign bitwise operation", "a|=b", "(|= a b)"},
{"Assign bitwise operation 2", "a|=b<<c", "(|= a (<< b c))"},
{"Function calls", "a()", "(λ a)"}, {"Function calls", "a()", "(λ a)"},
{"Function calls 2", "a(1)", "(λ a 1)"}, {"Function calls 2", "a(1)", "(λ a 1)"},
{"Function calls 3", "a(1)+1", "(+ (λ a 1) 1)"}, {"Function calls 3", "a(1)+1", "(+ (λ a 1) 1)"},
@ -116,10 +119,7 @@ func TestParse(t *testing.T) {
{"Dereferencing", "[a]", "(@ a)"}, {"Dereferencing", "[a]", "(@ a)"},
{"Dereferencing 2", "[a+b]", "(@ (+ a b))"}, {"Dereferencing 2", "[a+b]", "(@ (+ a b))"},
{"Dereferencing 3", "[a+b]=c", "(= (@ (+ a b)) c)"}, {"Dereferencing 3", "[a+b]=c", "(= (@ (+ a b)) c)"},
{"Dereferencing 3", "[a+b]=c+d", "(= (@ (+ a b)) (+ c d))"}, {"Dereferencing 4", "[a+b]=c+d", "(= (@ (+ a b)) (+ c d))"},
{"Assign bitwise OR", "a|=b", "(|= a b)"},
{"Assign bitwise OR 2", "a|=b<<c", "(|= a (<< b c))"},
} }
for _, test := range tests { for _, test := range tests {