refactor: move benchmark directory under test and update all references

The benchmark directory is relocated from the project root into the test directory, and all scripts, documentation links, and gitignore paths are updated accordingly. The test runner is also refactored to explicitly walk subdirectories (core, io, language, limit) instead of using a single test root, and a new test/README.md is added to document the test suite structure. Additionally, the constructor test for the Foo class is updated to add a zero-arity constructor and adjust expected output strings.
This commit is contained in:
Bob Nystrom
2015-03-14 19:45:56 +00:00
parent af58528e88
commit c4ef964f92
562 changed files with 32 additions and 8 deletions
+9
View File
@@ -0,0 +1,9 @@
var f
for (i in [1, 2, 3]) {
var j = 4
f = new Fn { IO.print(i + j) }
break
}
f.call()
// expect: 5
@@ -0,0 +1,9 @@
var f
while (true) {
var i = "i"
f = new Fn { IO.print(i) }
break
}
f.call()
// expect: i
@@ -0,0 +1,18 @@
for (i in 0..10) {
IO.print(i)
{
var a = "a"
{
var b = "b"
{
var c = "c"
if (i > 1) break
}
}
}
}
// expect: 0
// expect: 1
// expect: 2
+10
View File
@@ -0,0 +1,10 @@
for (i in [1, 2, 3, 4, 5]) {
IO.print(i)
if (i > 2) break
IO.print(i)
}
// expect: 1
// expect: 1
// expect: 2
// expect: 2
// expect: 3
@@ -0,0 +1,7 @@
var done = false
while (!done) {
new Fn {
break // expect error
}
done = true
}
@@ -0,0 +1,9 @@
var done = false
while (!done) {
class Foo {
method {
break // expect error
}
}
done = true
}
+12
View File
@@ -0,0 +1,12 @@
var i = 0
while (true) {
i = i + 1
IO.print(i)
if (i > 2) break
IO.print(i)
}
// expect: 1
// expect: 1
// expect: 2
// expect: 2
// expect: 3
+19
View File
@@ -0,0 +1,19 @@
for (i in 0..2) {
IO.print("outer ", i)
if (i > 1) break
for (j in 0..2) {
IO.print("inner ", j)
if (j > 1) break
}
}
// expect: outer 0
// expect: inner 0
// expect: inner 1
// expect: inner 2
// expect: outer 1
// expect: inner 0
// expect: inner 1
// expect: inner 2
// expect: outer 2
@@ -0,0 +1,25 @@
var i = 0
while (true) {
IO.print("outer ", i)
if (i > 1) break
var j = 0
while (true) {
IO.print("inner ", j)
if (j > 1) break
j = j + 1
}
i = i + 1
}
// expect: outer 0
// expect: inner 0
// expect: inner 1
// expect: inner 2
// expect: outer 1
// expect: inner 0
// expect: inner 1
// expect: inner 2
// expect: outer 2
+1
View File
@@ -0,0 +1 @@
break // expect error