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
@@ -0,0 +1,23 @@
class Foo {
getter {
IO.print("getter")
}
setter=(value) {
IO.print("setter")
}
method(a) {
IO.print("method")
}
}
class Bar is Foo {
test {
getter // expect: getter
setter = "value" // expect: setter
method("arg") // expect: method
}
}
(new Bar).test
@@ -0,0 +1,23 @@
class Foo {
getter {
IO.print("getter")
}
setter=(value) {
IO.print("setter")
}
method(a) {
IO.print("method")
}
test {
getter // expect: getter
setter = "value" // expect: setter
method("arg") // expect: method
}
}
(new Foo).test
// TODO: Need to decide how these interact with globals.
@@ -0,0 +1,17 @@
class Foo {
bar { "getter" }
test {
IO.print(bar) // expect: getter
{
IO.print(bar) // expect: getter
var bar = "local"
IO.print(bar) // expect: local
}
IO.print(bar) // expect: getter
}
}
(new Foo).test
@@ -0,0 +1,20 @@
class Foo {
bar=(value) {
IO.print("setter")
return value
}
test {
bar = "value" // expect: setter
{
bar = "value" // expect: setter
var bar = "local"
bar = "value" // no expectation
}
bar = "value" // expect: setter
}
}
(new Foo).test
@@ -0,0 +1,47 @@
class Outer {
getter {
IO.print("outer getter")
}
setter=(value) {
IO.print("outer setter")
}
method(a) {
IO.print("outer method")
}
test {
getter // expect: outer getter
setter = "value" // expect: outer setter
method("arg") // expect: outer method
class Inner {
getter {
IO.print("inner getter")
}
setter=(value) {
IO.print("inner setter")
}
method(a) {
IO.print("inner method")
}
test {
getter // expect: inner getter
setter = "value" // expect: inner setter
method("arg") // expect: inner method
}
}
(new Inner).test
getter // expect: outer getter
setter = "value" // expect: outer setter
method("arg") // expect: outer method
}
}
(new Outer).test
@@ -0,0 +1,21 @@
class Foo {
static getter {
IO.print("getter")
}
static setter=(value) {
IO.print("setter")
}
static method(a) {
IO.print("method")
}
static test {
getter // expect: getter
setter = "value" // expect: setter
method("arg") // expect: method
}
}
Foo.test