github.com/zaolin/u-root@v0.0.0-20200428085104-64aaafd46c6d/cmds/core/elvish/eval/compile_lvalue_test.go (about) 1 package eval 2 3 import "testing" 4 5 func TestAssignment(t *testing.T) { 6 runTests(t, []Test{ 7 That("x = a; put $x").Puts("a"), 8 That("x = [a]; x[0] = b; put $x[0]").Puts("b"), 9 That("x = a; { x = b }; put $x").Puts("b"), 10 That("x = [a]; { x[0] = b }; put $x[0]").Puts("b"), 11 }) 12 }