summaryrefslogtreecommitdiff
path: root/src/test/scala/forge/StaticContextTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/forge/StaticContextTests.scala')
-rw-r--r--src/test/scala/forge/StaticContextTests.scala36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/test/scala/forge/StaticContextTests.scala b/src/test/scala/forge/StaticContextTests.scala
new file mode 100644
index 00000000..0e764fef
--- /dev/null
+++ b/src/test/scala/forge/StaticContextTests.scala
@@ -0,0 +1,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)
+
+ }
+}