summaryrefslogtreecommitdiff
path: root/interp/interpreter_test.go
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2026-01-24 12:00:34 +0100
committerMarc Vertes <mvertes@free.fr>2026-01-24 12:00:34 +0100
commit51e11a29f9d2a9e571c3ea7c406863a025749ad6 (patch)
treec8190309c5e9620634615a09ae11503046e9240b /interp/interpreter_test.go
parent3113c7f058e427c49e936f82a518766ddb869c58 (diff)
fix: correct var order in multi-var declaration
Diffstat (limited to 'interp/interpreter_test.go')
-rw-r--r--interp/interpreter_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go
index ea4da53..adb550b 100644
--- a/interp/interpreter_test.go
+++ b/interp/interpreter_test.go
@@ -70,6 +70,13 @@ func TestExpr(t *testing.T) {
})
}
+func TestAssign(t *testing.T) {
+ run(t, []etest{
+ {src: "var a int = 1; a", res: "1"}, // #00
+ {src: "var a, b int = 1, 2; b", res: "2"}, // #01
+ })
+}
+
func TestCompare(t *testing.T) {
run(t, []etest{
{src: "a := 1; a < 2", res: "true"},