2018-02-15 17:14:05 +08:00
|
|
|
package vals
|
2018-01-25 09:40:15 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"testing"
|
|
|
|
|
2020-01-07 07:14:51 +08:00
|
|
|
. "github.com/elves/elvish/pkg/tt"
|
2018-01-25 09:40:15 +08:00
|
|
|
)
|
|
|
|
|
2018-02-01 00:36:01 +08:00
|
|
|
type xtype int
|
|
|
|
|
2018-01-25 09:40:15 +08:00
|
|
|
func TestKind(t *testing.T) {
|
2020-01-07 07:14:51 +08:00
|
|
|
Test(t, Fn("Kind", Kind), Table{
|
2019-04-08 05:49:28 +08:00
|
|
|
Args(nil).Rets("nil"),
|
2018-01-27 23:58:27 +08:00
|
|
|
Args(true).Rets("bool"),
|
|
|
|
Args("").Rets("string"),
|
2019-04-19 21:25:15 +08:00
|
|
|
Args(os.Stdin).Rets("file"),
|
2018-01-29 22:36:43 +08:00
|
|
|
Args(EmptyList).Rets("list"),
|
|
|
|
Args(EmptyMap).Rets("map"),
|
2019-04-20 00:40:45 +08:00
|
|
|
|
2018-02-15 17:14:05 +08:00
|
|
|
Args(xtype(0)).Rets("!!vals.xtype"),
|
2018-02-01 00:36:01 +08:00
|
|
|
|
2019-04-19 21:25:15 +08:00
|
|
|
Args(os.Stdin).Rets("file"),
|
2018-01-25 09:40:15 +08:00
|
|
|
})
|
|
|
|
}
|