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
+7
View File
@@ -0,0 +1,7 @@
class Foo {
getClosure { new Fn { toString } }
toString { "Foo" }
}
var closure = (new Foo).getClosure
IO.print(closure.call()) // expect: Foo
+22
View File
@@ -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
+7
View File
@@ -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
+6
View File
@@ -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
}