elvish/pkg/eval/vars/read_only_test.go
2020-04-13 16:29:01 +01:00

14 lines
247 B
Go

package vars
import "testing"
func TestNewReadOnly(t *testing.T) {
v := NewReadOnly("haha")
if v.Get() != "haha" {
t.Errorf("Get doesn't return initial value")
}
if v.Set("lala") != ErrSetReadOnlyVar {
t.Errorf("Set doesn't error")
}
}