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:
@@ -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