summaryrefslogtreecommitdiff
path: root/core/src/test/scala/forge/ApplicativeTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test/scala/forge/ApplicativeTests.scala')
-rw-r--r--core/src/test/scala/forge/ApplicativeTests.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/test/scala/forge/ApplicativeTests.scala b/core/src/test/scala/forge/ApplicativeTests.scala
index 000554ef..621dc679 100644
--- a/core/src/test/scala/forge/ApplicativeTests.scala
+++ b/core/src/test/scala/forge/ApplicativeTests.scala
@@ -94,6 +94,18 @@ object ApplicativeTests extends TestSuite {
counter.value == 1
)
}
+ 'evaluationsInsideLambdasWork - {
+ // This required some fiddling with owner chains inside the macro to get
+ // working, so ensure it doesn't regress
+ val counter = new Counter()
+ def up = Opt{ "hello" + counter() }
+ val down1 = Opt{ (() => up())() }
+ val down2 = Opt{ Seq(1, 2, 3).map(n => up() * n) }
+ assert(
+ down1 == Some("hello1"),
+ down2 == Some(Seq("hello2", "hello2hello2", "hello2hello2hello2"))
+ )
+ }
}
}