Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kitasuke committed Jan 31, 2019
1 parent daffe5a commit 35bbfd2
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions vm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,32 +425,32 @@ func TestBuiltinFunctions(t *testing.T) {
},
{`len([1, 2, 3])`, 3},
{`len([])`, 0},
//{`puts("hello", "world!")`, Null},
//{`first([1, 2, 3])`, 1},
//{`first()`, Null},
//{
// `first(1)`,
// &object.Error{
// Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNameFirst, object.ArrayObj, object.IntegerObj),
// },
//},
//{`last([1, 2, 3])`, 3},
//{`last()`, Null},
//{
// `last(1)`,
// &object.Error{
// Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNameLast, object.ArrayObj, object.IntegerObj),
// },
//},
//{`rest([1, 2, 3])`, []int{2, 3}},
//{`rest()`, Null},
//{`push([], 1)`, []int{1}},
//{
// `push(1, 1)`,
// &object.Error{
// Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNamePush, object.ArrayObj, object.IntegerObj),
// },
//},
{`puts("hello", "world!")`, Null},
{`first([1, 2, 3])`, 1},
{`first([])`, Null},
{
`first(1)`,
&object.Error{
Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNameFirst, object.ArrayObj, object.IntegerObj),
},
},
{`last([1, 2, 3])`, 3},
{`last([])`, Null},
{
`last(1)`,
&object.Error{
Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNameLast, object.ArrayObj, object.IntegerObj),
},
},
{`rest([1, 2, 3])`, []int{2, 3}},
{`rest([])`, Null},
{`push([], 1)`, []int{1}},
{
`push(1, 1)`,
&object.Error{
Message: fmt.Sprintf("argument to %q must be %s, got %s", object.BuiltinFuncNamePush, object.ArrayObj, object.IntegerObj),
},
},
}

runVmTests(t, tests)
Expand Down

0 comments on commit 35bbfd2

Please # to comment.