elvish/pkg/eval/vals/kind_test.go

31 lines
538 B
Go
Raw Normal View History

2018-02-15 17:14:05 +08:00
package vals
import (
"math/big"
"os"
"testing"
. "src.elv.sh/pkg/tt"
)
2018-02-01 00:36:01 +08:00
type xtype int
func TestKind(t *testing.T) {
Test(t, Fn("Kind", Kind), Table{
Args(nil).Rets("nil"),
Args(true).Rets("bool"),
Args("").Rets("string"),
Args(1).Rets("number"),
Args(bigInt(z)).Rets("number"),
Args(big.NewRat(1, 2)).Rets("number"),
Args(1.0).Rets("number"),
Args(os.Stdin).Rets("file"),
Args(EmptyList).Rets("list"),
Args(EmptyMap).Rets("map"),
2018-02-15 17:14:05 +08:00
Args(xtype(0)).Rets("!!vals.xtype"),
2018-02-01 00:36:01 +08:00
Args(os.Stdin).Rets("file"),
})
}