blob: 0e764fef8b4dc7cb0729f073a20f3d2b592fc73c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
package forge
import DefCtx.StaticContext
import utest._
class Helper{
val static = implicitly[StaticContext]
object Nested {
val static = implicitly[StaticContext]
}
def method = implicitly[StaticContext]
}
object StaticContextTests extends TestSuite{
val static = implicitly[StaticContext]
object Nested{
val static = implicitly[StaticContext]
def method = implicitly[StaticContext]
class Helper{
val static = implicitly[StaticContext]
}
}
def method = implicitly[StaticContext]
val tests = Tests{
val helper = new Helper()
'inObject - assert(static.value)
'inClass- assert(!helper.static.value)
'inMethod - assert(!method.value)
'inObjectObject - assert(Nested.static.value)
'inObjectClass- assert(!helper.static.value)
'inObjectMethod- assert(!Nested.method.value)
'inClassObject - assert(!helper.Nested.static.value)
'inClassMethod- assert(!helper.method.value)
}
}
|