mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-14 02:57:52 +08:00
25 lines
475 B
Go
25 lines
475 B
Go
package vals
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/elves/elvish/tt"
|
|
)
|
|
|
|
type xtype int
|
|
|
|
func TestKind(t *testing.T) {
|
|
tt.Test(t, tt.Fn("Kind", Kind), tt.Table{
|
|
Args(true).Rets("bool"),
|
|
Args("").Rets("string"),
|
|
Args(EmptyList).Rets("list"),
|
|
Args(EmptyMap).Rets("map"),
|
|
Args(xtype(0)).Rets("!!vals.xtype"),
|
|
|
|
Args(NewStruct(NewStructDescriptor(), nil)).Rets("map"),
|
|
Args(NewFile(os.Stdin)).Rets("file"),
|
|
Args(NewPipe(os.Stdin, os.Stdout)).Rets("pipe"),
|
|
})
|
|
}
|