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
+18
View File
@@ -0,0 +1,18 @@
class Foo {
new(value) { _value = value }
toString { _value }
bar=(value) {
_value = value
return value
}
}
var a = new Foo("a")
var b = new Foo("b")
var c = new Foo("c")
// Assignment is right-associative.
a.bar = b.bar = c.bar = "d"
IO.print(a.toString) // expect: d
IO.print(b.toString) // expect: d
IO.print(c.toString) // expect: d
+6
View File
@@ -0,0 +1,6 @@
class Foo {
bar=(value) { value }
}
var foo = new Foo
(foo.bar) = "value" // expect error
+6
View File
@@ -0,0 +1,6 @@
class Foo {
bar=(value) { value }
}
var foo = new Foo
"a" + foo.bar = "value" // expect error
+8
View File
@@ -0,0 +1,8 @@
class Foo {
bar=(value) {
IO.print(value)
}
}
var foo = new Foo
foo.bar = "value" // expect: value
+6
View File
@@ -0,0 +1,6 @@
class Foo {
bar=(value) { value }
}
var foo = new Foo
a is foo.bar = "value" // expect error
@@ -0,0 +1,6 @@
class Foo {
bar=(value) { value }
}
var foo = new Foo
!foo.bar = "value" // expect error
+6
View File
@@ -0,0 +1,6 @@
class Foo {
bar=(value) { "result" }
}
var foo = new Foo
IO.print(foo.bar = "value") // expect: result
@@ -0,0 +1,8 @@
class Foo {
bar=(value) { IO.print("set") }
bar { IO.print("get") }
}
var foo = new Foo
foo.bar = "value" // expect: set
foo.bar // expect: get
+7
View File
@@ -0,0 +1,7 @@
class Foo {
static bar=(value) {
IO.print(value)
}
}
Foo.bar = "value" // expect: value