You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/scala/catslib/EvalSection.scala
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -59,15 +59,15 @@ object EvalSection extends AnyFlatSpec with Matchers with org.scalaexercises.def
59
59
* eager.value
60
60
* // res0: Int = 7
61
61
*/
62
-
defnowEval(resultList: List[Int]) = {
62
+
defnowEval(res0: List[Int]) = {
63
63
//given
64
64
valeagerEval=Eval.now {
65
65
println("This is eagerly evaluated")
66
66
1::2::3::Nil
67
67
}
68
68
69
69
//when/then
70
-
eagerEval.value shouldBe (resultList: List[Int])
70
+
eagerEval.value shouldBe (res0)
71
71
}
72
72
73
73
/**
@@ -97,7 +97,7 @@ object EvalSection extends AnyFlatSpec with Matchers with org.scalaexercises.def
97
97
* First, it allows the runtime to perform garbage collection of the thunk after evaluation, leading to more memory being freed earlier.
98
98
* Secondly, when lazy vals are evaluated, in order to preserve thread-safety, the Scala compiler will lock the whole surrounding class, whereas Eval will only lock itself.
0 commit comments