diff options
| author | Marc Vertes <mvertes@free.fr> | 2026-01-09 19:10:27 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2026-01-09 19:10:27 +0100 |
| commit | 7520aa4474ea30985cf26631c6bbdebf38484a0d (patch) | |
| tree | e1e344c2fdc04affc0095eab26a39eef1fc3ba91 /interp | |
| parent | 6ae0a2530c9a57fc093d2159591d9cae8140d641 (diff) | |
feat: initial support for maps
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/interpreter_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go index c7c3cbc..6c92102 100644 --- a/interp/interpreter_test.go +++ b/interp/interpreter_test.go @@ -217,6 +217,12 @@ func TestStruct(t *testing.T) { }) } +func TestMap(t *testing.T) { + run(t, []etest{ + {src: `type M map[string]bool; var m M; m`, res: `map[]`}, // #00 + }) +} + func TestType(t *testing.T) { src0 := `type ( I int @@ -271,5 +277,7 @@ func TestComposite(t *testing.T) { {src: `type T struct{N int; S string}; t := T{S: "foo"}; t`, res: `{0 foo}`}, // #05 {src: `a := []int{}`, res: `[]`}, // #06 {src: `a := []int{1, 2, 3}; a`, res: `[1 2 3]`}, // #07 + {src: `m := map[string]bool{}`, res: `map[]`}, // #08 + {src: `m := map[string]bool{"hello": true}; m`, res: `map[hello:true]`}, // #09 }) } |
