summaryrefslogtreecommitdiff
path: root/interp
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2026-01-08 23:46:02 +0100
committerMarc Vertes <mvertes@free.fr>2026-01-08 23:46:02 +0100
commit6ae0a2530c9a57fc093d2159591d9cae8140d641 (patch)
tree8c445c99bf3140930ead8ad8c70ebbed9838074e /interp
parent6875facb39de63eb6353be2f700b9eacb631e9fa (diff)
fix: improve composite literal for slices
Diffstat (limited to 'interp')
-rw-r--r--interp/interpreter_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/interp/interpreter_test.go b/interp/interpreter_test.go
index 5d0dd55..c7c3cbc 100644
--- a/interp/interpreter_test.go
+++ b/interp/interpreter_test.go
@@ -269,7 +269,7 @@ func TestComposite(t *testing.T) {
{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: `a := []int{}`, res: `[]`}, // #06
- // {src: `a := []int{1, 2, 3}`, res: `[1 2 3]`}, // #07
+ {src: `a := []int{}`, res: `[]`}, // #06
+ {src: `a := []int{1, 2, 3}; a`, res: `[1 2 3]`}, // #07
})
}