elvish/eval/builtin_fn_test.go

23 lines
477 B
Go
Raw Normal View History

package eval
var builtinFnTests = []evalTest{
// Builtin functions
// -----------------
{"kind-of bare 'str' [] [&] []{ }",
want{out: strs("string", "string", "list", "map", "fn")}},
{`is 1 1`, wantTrue},
{`is [] []`, wantTrue},
{`is [1] [1]`, wantFalse},
{`eq 1 1`, wantTrue},
{`eq [] []`, wantTrue},
2017-12-17 13:20:03 +08:00
{`f=(constantly foo); $f; $f`, want{out: strs("foo", "foo")}},
{`(constantly foo) bad`, want{err: errAny}},
}
func init() {
addToEvalTests(builtinFnTests)
}