eval: More tests against builtins.

This commit is contained in:
Qi Xiao 2017-12-18 20:28:33 +00:00
parent 347782b868
commit 1874df52c3

View File

@ -22,13 +22,19 @@ var builtinFnTests = []evalTest{
{`bool $false`, wantFalse},
{`not $false`, wantTrue},
{`not ?(fail x)`, wantTrue},
{`not $true`, wantFalse},
{`not 0`, wantFalse},
{`is 1 1`, wantTrue},
{`is a b`, wantFalse},
{`is [] []`, wantTrue},
{`is [1] [1]`, wantFalse},
{`eq 1 1`, wantTrue},
{`eq a b`, wantFalse},
{`eq [] []`, wantTrue},
{`eq [1] [1]`, wantTrue},
{`not-eq a b`, wantTrue},
{`f=(constantly foo); $f; $f`, want{out: strs("foo", "foo")}},
{`(constantly foo) bad`, want{err: errAny}},