mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 01:47:51 +08:00
27 lines
478 B
Go
27 lines
478 B
Go
package vars
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/elves/elvish/pkg/tt"
|
|
)
|
|
|
|
func TestBlackhole(t *testing.T) {
|
|
v := NewBlackhole()
|
|
err := v.Set("foo")
|
|
if err != nil {
|
|
t.Errorf("v.Set(%q) -> %v, want nil", "foo", err)
|
|
}
|
|
val := v.Get()
|
|
if val != nil {
|
|
t.Errorf("v.Get() -> %v, want nil", val)
|
|
}
|
|
}
|
|
|
|
func TestIsBlackhole(t *testing.T) {
|
|
tt.Test(t, tt.Fn("IsBlackhole", IsBlackhole), tt.Table{
|
|
tt.Args(NewBlackhole()).Rets(true),
|
|
tt.Args(FromInit("")).Rets(false),
|
|
})
|
|
}
|