Skip to content

Commit c1799d2

Browse files
committed
- Add tests to ensure lazy vals in test blocks now work in Scala 2.12.x
1 parent 36c2c3d commit c1799d2

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,11 @@ Changelog
971971
- Using uTest with `fork in Test := true` in SBT no longer gives an incorrect
972972
results summmary
973973

974+
- Fix problem with lazy vals in test blocks crashing the compiler
975+
[#67](https://github.com/lihaoyi/utest/issues/67). Note that the issue is only
976+
fixed on 2.12.3, and not on Scala 2.10.x or 2.11.x.
977+
978+
974979
0.4.8
975980
-----
976981

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package test.utest
2+
3+
import utest._
4+
5+
object What {
6+
def imported = 2
7+
}
8+
9+
object LazyValTest extends TestSuite {
10+
override def tests = TestSuite {
11+
import What._
12+
lazy val subj = imported
13+
'test{
14+
lazy val y = "hello"
15+
'inner{
16+
lazy val z = "world"
17+
val res = y * imported + z
18+
assert(res == "hellohelloworld")
19+
res
20+
}
21+
'inner2{
22+
lazy val terminalLazyVal = y
23+
}
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)