diff options
| author | Marc Vertes <mvertes@free.fr> | 2026-01-07 19:06:23 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2026-01-07 19:06:23 +0100 |
| commit | 6875facb39de63eb6353be2f700b9eacb631e9fa (patch) | |
| tree | 31b8d7c8701df2f52a7b3cecc82dd775c9d9f428 /interp | |
| parent | ca80eeaa812b49afea75d3084d0c62770e4a8d18 (diff) | |
fix: improve handling of composite literal struct expressions
Diffstat (limited to 'interp')
| -rw-r--r-- | interp/interpreter_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go index e1e7107..5d0dd55 100644 --- a/interp/interpreter_test.go +++ b/interp/interpreter_test.go @@ -251,7 +251,7 @@ func TestImport(t *testing.T) { ) ` run(t, []etest{ - {src: "fmt.Println(4)", err: "missing symbol"}, // #00 + {src: "fmt.Println(4)", err: "invalid symbol: fmt"}, // #00 {src: `import "xxx"`, err: "package not found: xxx"}, // #01 {src: `import "fmt"; fmt.Println(4)`, res: "<nil>"}, // #02 {src: src0 + "fmt.Println(4)", res: "<nil>"}, // #03 @@ -268,7 +268,7 @@ func TestComposite(t *testing.T) { {src: `type T struct {}; var t T; t = T{}; t`, res: "{}"}, // #02 {src: `type T struct{N int; S string}; var t T; t = T{2, "foo"}; t`, res: `{2 foo}`}, // #03 {src: `type T struct{N int; S string}; t := T{2, "foo"}; t`, res: `{2 foo}`}, // #04 - // {src: `type T struct{N int; S string}; t := T{S: "foo"}; t`, res: `{0 foo}`}, // #05 + {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}`, res: `[1 2 3]`}, // #07 }) |
