summaryrefslogtreecommitdiff
path: root/src/test/scala/forge/EvaluationTests.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/forge/EvaluationTests.scala')
-rw-r--r--src/test/scala/forge/EvaluationTests.scala46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/test/scala/forge/EvaluationTests.scala b/src/test/scala/forge/EvaluationTests.scala
index 34ebd684..2ab6d31e 100644
--- a/src/test/scala/forge/EvaluationTests.scala
+++ b/src/test/scala/forge/EvaluationTests.scala
@@ -14,89 +14,89 @@ object EvaluationTests extends TestSuite{
'evaluateSingle - {
val evaluator = new Evaluator(jnio.Paths.get("target/workspace"), baseCtx)
- def check(target: Target[_], expValue: Any, expEvaled: Seq[Target[_]]) = {
- val Evaluator.Results(returnedValues, returnedEvaluated) = evaluator.evaluate(Seq(target))
+ def check(target: Target[_], expValue: Any, expEvaled: OSet[Target[_]]) = {
+ val Evaluator.Results(returnedValues, returnedEvaluated) = evaluator.evaluate(OSet(target))
assert(
returnedValues == Seq(expValue),
returnedEvaluated == expEvaled
)
// Second time the value is already cached, so no evaluation needed
- val Evaluator.Results(returnedValues2, returnedEvaluated2) = evaluator.evaluate(Seq(target))
+ val Evaluator.Results(returnedValues2, returnedEvaluated2) = evaluator.evaluate(OSet(target))
assert(
returnedValues2 == returnedValues,
- returnedEvaluated2 == Nil
+ returnedEvaluated2 == OSet()
)
}
'singleton - {
import singleton._
// First time the target is evaluated
- check(single, expValue = 0, expEvaled = Seq(single))
+ check(single, expValue = 0, expEvaled = OSet(single))
single.counter += 1
// After incrementing the counter, it forces re-evaluation
- check(single, expValue = 1, expEvaled = Seq(single))
+ check(single, expValue = 1, expEvaled = OSet(single))
}
'pair - {
import pair._
- check(down, expValue = 0, expEvaled = Seq(up, down))
+ check(down, expValue = 0, expEvaled = OSet(up, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = Seq(down))
+ check(down, expValue = 1, expEvaled = OSet(down))
up.counter += 1
- check(down, expValue = 2, expEvaled = Seq(up, down))
+ check(down, expValue = 2, expEvaled = OSet(up, down))
}
'anonTriple - {
import anonTriple._
val middle = down.inputs(0)
- check(down, expValue = 0, expEvaled = Seq(up, middle, down))
+ check(down, expValue = 0, expEvaled = OSet(up, middle, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = Seq(down))
+ check(down, expValue = 1, expEvaled = OSet(down))
up.counter += 1
- check(down, expValue = 2, expEvaled = Seq(up, middle, down))
+ check(down, expValue = 2, expEvaled = OSet(up, middle, down))
middle.asInstanceOf[Target.Test].counter += 1
- check(down, expValue = 3, expEvaled = Seq(middle, down))
+ check(down, expValue = 3, expEvaled = OSet(middle, down))
}
'diamond - {
import diamond._
- check(down, expValue = 0, expEvaled = Seq(up, left, right, down))
+ check(down, expValue = 0, expEvaled = OSet(up, left, right, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = Seq(down))
+ check(down, expValue = 1, expEvaled = OSet(down))
up.counter += 1
// Increment by 2 because up is referenced twice: once by left once by right
- check(down, expValue = 3, expEvaled = Seq(up, left, right, down))
+ check(down, expValue = 3, expEvaled = OSet(up, left, right, down))
left.counter += 1
- check(down, expValue = 4, expEvaled = Seq(left, down))
+ check(down, expValue = 4, expEvaled = OSet(left, down))
right.counter += 1
- check(down, expValue = 5, expEvaled = Seq(right, down))
+ check(down, expValue = 5, expEvaled = OSet(right, down))
}
'anonDiamond - {
import anonDiamond._
val left = down.inputs(0).asInstanceOf[Target.Test]
val right = down.inputs(1).asInstanceOf[Target.Test]
- check(down, expValue = 0, expEvaled = Seq(up, left, right, down))
+ check(down, expValue = 0, expEvaled = OSet(up, left, right, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = Seq(down))
+ check(down, expValue = 1, expEvaled = OSet(down))
up.counter += 1
// Increment by 2 because up is referenced twice: once by left once by right
- check(down, expValue = 3, expEvaled = Seq(up, left, right, down))
+ check(down, expValue = 3, expEvaled = OSet(up, left, right, down))
left.counter += 1
- check(down, expValue = 4, expEvaled = Seq(left, down))
+ check(down, expValue = 4, expEvaled = OSet(left, down))
right.counter += 1
- check(down, expValue = 5, expEvaled = Seq(right, down))
+ check(down, expValue = 5, expEvaled = OSet(right, down))
}
// 'anonImpureDiamond - {
// import AnonImpureDiamond._