blob: 022cfd1ec87f32ae4f1c8f56a8c86cb9f0d372c8 (
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 hbt
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)
}
}
|