mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-12 17:27:50 +08:00
14 lines
247 B
Go
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")
|
|
}
|
|
}
|