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:
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
getClosure { new Fn { toString } }
|
||||
toString { "Foo" }
|
||||
}
|
||||
|
||||
var closure = (new Foo).getClosure
|
||||
IO.print(closure.call()) // expect: Foo
|
||||
@@ -0,0 +1,22 @@
|
||||
class Outer {
|
||||
method {
|
||||
IO.print(this) // expect: Outer
|
||||
|
||||
new Fn {
|
||||
IO.print(this) // expect: Outer
|
||||
|
||||
class Inner {
|
||||
method {
|
||||
IO.print(this) // expect: Inner
|
||||
}
|
||||
toString { "Inner" }
|
||||
}
|
||||
|
||||
(new Inner).method
|
||||
}.call()
|
||||
}
|
||||
|
||||
toString { "Outer" }
|
||||
}
|
||||
|
||||
(new Outer).method
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
getClosure { new Fn { new Fn { new Fn { toString } } } }
|
||||
toString { "Foo" }
|
||||
}
|
||||
|
||||
var closure = (new Foo).getClosure
|
||||
IO.print(closure.call().call().call()) // expect: Foo
|
||||
@@ -0,0 +1 @@
|
||||
this // expect error
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar { this }
|
||||
baz { "baz" }
|
||||
}
|
||||
|
||||
IO.print((new Foo).bar.baz) // expect: baz
|
||||
@@ -0,0 +1,10 @@
|
||||
class Foo {
|
||||
static test {
|
||||
IO.print(this == Foo) // expect: true
|
||||
IO.print(this.bar) // expect: bar
|
||||
}
|
||||
|
||||
static bar { "bar" }
|
||||
}
|
||||
|
||||
Foo.test
|
||||
@@ -0,0 +1,3 @@
|
||||
new Fn {
|
||||
this // expect error
|
||||
}
|
||||
Reference in New Issue
Block a user