Reorganize tests and benchmark scripts.

Mainly to get rid of one top level directory. But this will
also be useful when there are tests of the embedding API.
This commit is contained in:
Bob Nystrom
2015-03-14 12:45:56 -07:00
parent e2a72282a1
commit 64eccdd9be
562 changed files with 32 additions and 8 deletions
+13
View File
@@ -0,0 +1,13 @@
var list = []
var i = 1
while (i < 4) {
var j = i + 1
list.add(new Fn { IO.print(j) })
i = i + 1
}
for (f in list) f.call()
// expect: 2
// expect: 3
// expect: 4
@@ -0,0 +1,2 @@
while // expect error
(true) IO.print("bad")
+10
View File
@@ -0,0 +1,10 @@
var f = new Fn {
while (true) {
var i = "i"
return new Fn { IO.print(i) }
}
}
var g = f.call()
g.call()
// expect: i
+9
View File
@@ -0,0 +1,9 @@
var f = new Fn {
while (true) {
var i = "i"
return i
}
}
IO.print(f.call())
// expect: i
+16
View File
@@ -0,0 +1,16 @@
// Single-expression body.
var c = 0
while (c < 3) IO.print(c = c + 1)
// expect: 1
// expect: 2
// expect: 3
// Block body.
var a = 0
while (a < 3) {
IO.print(a)
a = a + 1
}
// expect: 0
// expect: 1
// expect: 2
+26
View File
@@ -0,0 +1,26 @@
// False and null are false.
while (false) {
IO.print("bad")
break
}
while (null) {
IO.print("bad")
break
}
// Everything else is true.
while (true) {
IO.print("true") // expect: true
break
}
while (0) {
IO.print(0) // expect: 0
break
}
while ("") {
IO.print("string") // expect: string
break
}