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
@@ -0,0 +1,20 @@
class Base {
foo { IO.print("Base.foo") }
foo(a) { IO.print("Base.foo(a)") }
foo(a, b) { IO.print("Base.foo(a, b)") }
}
class Derived is Base {
foo(a) {
IO.print("Derived.bar(a)")
super
super(1)
super(1, 2)
}
}
(new Derived).foo(1)
// expect: Derived.bar(a)
// expect: Base.foo
// expect: Base.foo(a)
// expect: Base.foo(a, b)
@@ -0,0 +1,19 @@
class Base {
foo {
IO.print("Base.foo")
}
}
class Derived is Base {
bar {
IO.print("Derived.bar")
super.foo
}
}
(new Derived).bar
// expect: Derived.bar
// expect: Base.foo
// TODO: Super operator calls.
// TODO: Super setter calls.
+16
View File
@@ -0,0 +1,16 @@
class Base {
foo {
IO.print("Base.foo")
}
}
class Derived is Base {
foo {
IO.print("Derived.foo")
super.foo
}
}
(new Derived).foo
// expect: Derived.foo
// expect: Base.foo
+11
View File
@@ -0,0 +1,11 @@
class Base {
toString { "Base" }
}
class Derived is Base {
getClosure { new Fn { super.toString } }
toString { "Derived" }
}
var closure = (new Derived).getClosure
IO.print(closure.call()) // expect: Base
+16
View File
@@ -0,0 +1,16 @@
class Base {
foo {
IO.print("Base.foo")
}
}
class Derived is Base {
foo {
IO.print("Derived.foo")
super
}
}
(new Derived).foo
// expect: Derived.foo
// expect: Base.foo
@@ -0,0 +1,18 @@
class A {
foo {
IO.print("A.foo")
}
}
class B is A {}
class C is B {
foo {
IO.print("C.foo")
super.foo
}
}
(new C).foo
// expect: C.foo
// expect: A.foo
@@ -0,0 +1,7 @@
class Base {}
class Derived is Base {
foo { super.doesNotExist(1) } // expect runtime error: Base does not implement 'doesNotExist(_)'.
}
(new Derived).foo
@@ -0,0 +1,4 @@
super.foo // expect error
super // expect error
super.foo("bar") // expect error
super("foo") // expect error
@@ -0,0 +1,5 @@
class Foo {
static method {
super // expect error
}
}
@@ -0,0 +1,3 @@
new Fn {
super.foo // expect error
}