github.com/xyproto/u-root@v6.0.1-0.20200302025726-5528e0c77a3c+incompatible/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  }