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 @@
|
||||
var Nonlocal = "before"
|
||||
IO.print(Nonlocal) // expect: before
|
||||
Nonlocal = "after"
|
||||
IO.print(Nonlocal) // expect: after
|
||||
|
||||
class Foo {
|
||||
static method {
|
||||
Nonlocal = "method"
|
||||
}
|
||||
}
|
||||
|
||||
Foo.method
|
||||
IO.print(Nonlocal) // expect: method
|
||||
|
||||
new Fn {
|
||||
Nonlocal = "fn"
|
||||
}.call()
|
||||
IO.print(Nonlocal) // expect: fn
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
bar {
|
||||
var A = "value"
|
||||
var A = "other" // expect error
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
var Nonlocal = "outer"
|
||||
|
||||
{
|
||||
var Nonlocal = "inner"
|
||||
IO.print(Nonlocal) // expect: inner
|
||||
}
|
||||
|
||||
IO.print(Nonlocal) // expect: outer
|
||||
@@ -0,0 +1,10 @@
|
||||
class Foo {
|
||||
static bar { new Bar }
|
||||
}
|
||||
|
||||
class Bar {
|
||||
static foo { new Foo }
|
||||
}
|
||||
|
||||
IO.print(Foo.bar) // expect: instance of Bar
|
||||
IO.print(Bar.foo) // expect: instance of Foo
|
||||
@@ -0,0 +1,3 @@
|
||||
IO.print(Foo) // expect: null
|
||||
var Foo = "value"
|
||||
IO.print(Foo) // expect: value
|
||||
@@ -0,0 +1,7 @@
|
||||
var fn = new Fn {
|
||||
IO.print(Foo)
|
||||
IO.print(Bar)
|
||||
}
|
||||
|
||||
// expect error line 7
|
||||
// expect error line 7
|
||||
@@ -0,0 +1,5 @@
|
||||
var Global = "global"
|
||||
|
||||
new Fn {
|
||||
IO.print(Global) // expect: global
|
||||
}.call()
|
||||
@@ -0,0 +1,7 @@
|
||||
var f = new Fn {
|
||||
IO.print(Global)
|
||||
}
|
||||
|
||||
var Global = "global"
|
||||
|
||||
f.call() // expect: global
|
||||
@@ -0,0 +1,14 @@
|
||||
var Global = "global"
|
||||
|
||||
class Foo {
|
||||
method {
|
||||
IO.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
(new Foo).method // expect: global
|
||||
Foo.classMethod // expect: global
|
||||
@@ -0,0 +1,14 @@
|
||||
class Foo {
|
||||
method {
|
||||
IO.print(Global)
|
||||
}
|
||||
|
||||
static classMethod {
|
||||
IO.print(Global)
|
||||
}
|
||||
}
|
||||
|
||||
var Global = "global"
|
||||
|
||||
(new Foo).method // expect: global
|
||||
Foo.classMethod // expect: global
|
||||
Reference in New Issue
Block a user