elvish/pkg/eval/compile_lvalue_test.go

17 lines
325 B
Go

package eval_test
import (
"testing"
. "github.com/elves/elvish/pkg/eval/evaltest"
)
func TestAssignment(t *testing.T) {
Test(t,
That("x = a; put $x").Puts("a"),
That("x = [a]; x[0] = b; put $x[0]").Puts("b"),
That("x = a; { x = b }; put $x").Puts("b"),
That("x = [a]; { x[0] = b }; put $x[0]").Puts("b"),
)
}