More tests
Some checks failed
Build / build (push) Failing after 1m26s
Test / build (push) Failing after 11m43s

This commit is contained in:
Chuck Smith
2024-03-18 19:46:54 -04:00
parent c59ce311b0
commit ca4eed10b8
16 changed files with 124 additions and 24 deletions

2
testdata/arrays.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
let xs = [1, 2, 3]
xs[0] + xs[1] + xs[2]

3
testdata/assign.monkey vendored Normal file
View File

@@ -0,0 +1,3 @@
let x = 1
x = 2
x = x + 1

13
testdata/builtins.monkey vendored Normal file
View File

@@ -0,0 +1,13 @@
let xs = [1, 2, 3]
len(xs)
first(xs)
rest(xs)
last(xs)
push(xs, 5)
pop(xs)
len("foo")
let x = input()
print(x)

2
testdata/closures.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
let f = fn(x) { fn() { x + 1 } }
f(2)

2
testdata/expressions.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
1 + 2;
(1 + 2) * 3;

2
testdata/functions.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
let f = fn(x, y) { x * y };
f(2, 4)

2
testdata/hashes.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
let d = {"a": 1, "b": 2}
d["a"] + d["b"]

5
testdata/if.monkey vendored Normal file
View File

@@ -0,0 +1,5 @@
let x = 1
if (x == 1) {
x = 2
x
}

3
testdata/let.monkey vendored Normal file
View File

@@ -0,0 +1,3 @@
let x = 1
let y = 2
let z = x

2
testdata/strings.monkey vendored Normal file
View File

@@ -0,0 +1,2 @@
let s = "hello"
s + " " + "world"