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,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
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
(foo.bar) = "value" // expect error
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar=(value) { value }
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
"a" + foo.bar = "value" // expect error
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foo {
|
||||
bar=(value) {
|
||||
IO.print(value)
|
||||
}
|
||||
}
|
||||
|
||||
var foo = new Foo
|
||||
foo.bar = "value" // expect: value
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
class Foo {
|
||||
static bar=(value) {
|
||||
IO.print(value)
|
||||
}
|
||||
}
|
||||
|
||||
Foo.bar = "value" // expect: value
|
||||
Reference in New Issue
Block a user