optimizations
Some checks failed
Build / build (push) Successful in 10m29s
Publish Image / publish (push) Failing after 31s
Test / build (push) Failing after 6m34s

This commit is contained in:
Chuck Smith
2024-04-02 14:08:08 -04:00
parent 4c9ec5aaaa
commit 07fd82b261
23 changed files with 296 additions and 265 deletions

View File

@@ -713,12 +713,10 @@ func TestBuiltinFunctions(t *testing.T) {
{`len("hello world")`, 11},
{
`len(1)`,
&object.Error{
Message: "TypeError: object of type 'int' has no len()",
},
fmt.Errorf("TypeError: object of type 'int' has no len()"),
},
{`len("one", "two")`,
&object.Error{
object.Error{
Message: "TypeError: len() takes exactly 1 argument (2 given)",
},
},
@@ -728,14 +726,14 @@ func TestBuiltinFunctions(t *testing.T) {
{`first([1, 2, 3])`, 1},
{`first([])`, object.NULL},
{`first(1)`,
&object.Error{
object.Error{
Message: "TypeError: first() expected argument #1 to be `array` got `int`",
},
},
{`last([1, 2, 3])`, 3},
{`last([])`, object.NULL},
{`last(1)`,
&object.Error{
object.Error{
Message: "TypeError: last() expected argument #1 to be `array` got `int`",
},
},
@@ -743,12 +741,12 @@ func TestBuiltinFunctions(t *testing.T) {
{`rest([])`, []int{}},
{`push([], 1)`, []int{1}},
{`push(1, 1)`,
&object.Error{
object.Error{
Message: "TypeError: push() expected argument #1 to be `array` got `int`",
},
},
{`input()`, ""},
{`pop([])`, &object.Error{
{`pop([])`, object.Error{
Message: "IndexError: pop from an empty array",
},
},