summaryrefslogtreecommitdiff
path: root/core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/test')
-rw-r--r--core/src/test/scala/mill/define/CacherTests.scala4
-rw-r--r--core/src/test/scala/mill/define/GraphTests.scala70
-rw-r--r--core/src/test/scala/mill/discover/ConsistencyTests.scala8
-rw-r--r--core/src/test/scala/mill/eval/EvaluationTests.scala96
-rw-r--r--core/src/test/scala/mill/eval/FailureTests.scala4
-rw-r--r--core/src/test/scala/mill/eval/JavaCompileJarTests.scala34
-rw-r--r--core/src/test/scala/mill/util/TestEvaluator.scala4
-rw-r--r--core/src/test/scala/mill/util/TestUtil.scala4
8 files changed, 112 insertions, 112 deletions
diff --git a/core/src/test/scala/mill/define/CacherTests.scala b/core/src/test/scala/mill/define/CacherTests.scala
index 4127a75b..5fca1ff0 100644
--- a/core/src/test/scala/mill/define/CacherTests.scala
+++ b/core/src/test/scala/mill/define/CacherTests.scala
@@ -3,7 +3,7 @@ package mill.define
import mill.discover.Discovered
import mill.eval.Evaluator
import mill.util.{DummyLogger, TestUtil}
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import mill.T
import mill.eval.Result.Success
import utest._
@@ -31,7 +31,7 @@ object CacherTests extends TestSuite{
def eval[V](mapping: Discovered.Mapping[_], v: Task[V])(implicit tp: TestPath) = {
val workspace = ammonite.ops.pwd / 'target / 'workspace / tp.value
val evaluator = new Evaluator(workspace, ammonite.ops.pwd, mapping, DummyLogger)
- evaluator.evaluate(OSet(v)).values(0)
+ evaluator.evaluate(Agg(v)).values(0)
}
'simpleDefIsCached - assert(
diff --git a/core/src/test/scala/mill/define/GraphTests.scala b/core/src/test/scala/mill/define/GraphTests.scala
index 7241087a..3988328b 100644
--- a/core/src/test/scala/mill/define/GraphTests.scala
+++ b/core/src/test/scala/mill/define/GraphTests.scala
@@ -6,7 +6,7 @@ import Discovered.mapping
import mill.eval.Evaluator
import mill.util.{TestGraphs, TestUtil}
import utest._
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
object GraphTests extends TestSuite{
val tests = Tests{
@@ -17,31 +17,31 @@ object GraphTests extends TestSuite{
import TestGraphs._
'topoSortedTransitiveTargets - {
- def check(targets: OSet[Task[_]], expected: OSet[Task[_]]) = {
+ def check(targets: Agg[Task[_]], expected: Agg[Task[_]]) = {
val result = Graph.topoSorted(Graph.transitiveTargets(targets)).values
TestUtil.checkTopological(result)
assert(result == expected)
}
'singleton - check(
- targets = OSet(singleton.single),
- expected = OSet(singleton.single)
+ targets = Agg(singleton.single),
+ expected = Agg(singleton.single)
)
'pair - check(
- targets = OSet(pair.down),
- expected = OSet(pair.up, pair.down)
+ targets = Agg(pair.down),
+ expected = Agg(pair.up, pair.down)
)
'anonTriple - check(
- targets = OSet(anonTriple.down),
- expected = OSet(anonTriple.up, anonTriple.down.inputs(0), anonTriple.down)
+ targets = Agg(anonTriple.down),
+ expected = Agg(anonTriple.up, anonTriple.down.inputs(0), anonTriple.down)
)
'diamond - check(
- targets = OSet(diamond.down),
- expected = OSet(diamond.up, diamond.left, diamond.right, diamond.down)
+ targets = Agg(diamond.down),
+ expected = Agg(diamond.up, diamond.left, diamond.right, diamond.down)
)
'anonDiamond - check(
- targets = OSet(diamond.down),
- expected = OSet(
+ targets = Agg(diamond.down),
+ expected = Agg(
diamond.up,
diamond.down.inputs(0),
diamond.down.inputs(1),
@@ -49,8 +49,8 @@ object GraphTests extends TestSuite{
)
)
'defCachedDiamond - check(
- targets = OSet(defCachedDiamond.down),
- expected = OSet(
+ targets = Agg(defCachedDiamond.down),
+ expected = Agg(
defCachedDiamond.up.inputs(0),
defCachedDiamond.up,
defCachedDiamond.down.inputs(0).inputs(0).inputs(0),
@@ -62,7 +62,7 @@ object GraphTests extends TestSuite{
)
)
'bigSingleTerminal - {
- val result = Graph.topoSorted(Graph.transitiveTargets(OSet(bigSingleTerminal.j))).values
+ val result = Graph.topoSorted(Graph.transitiveTargets(Agg(bigSingleTerminal.j))).values
TestUtil.checkTopological(result)
assert(result.size == 28)
}
@@ -71,46 +71,46 @@ object GraphTests extends TestSuite{
'groupAroundNamedTargets - {
def check[T, R <: Target[Int]](base: T)
(target: T => R,
- important0: OSet[T => Target[_]],
- expected: OSet[(R, Int)]) = {
+ important0: Agg[T => Target[_]],
+ expected: Agg[(R, Int)]) = {
- val topoSorted = Graph.topoSorted(Graph.transitiveTargets(OSet(target(base))))
+ val topoSorted = Graph.topoSorted(Graph.transitiveTargets(Agg(target(base))))
val important = important0.map(_ (base))
val grouped = Graph.groupAroundImportantTargets(topoSorted) {
case t: Target[_] if important.contains(t) => t
}
- val flattened = OSet.from(grouped.values().flatMap(_.items))
+ val flattened = Agg.from(grouped.values().flatMap(_.items))
TestUtil.checkTopological(flattened)
for ((terminal, expectedSize) <- expected) {
val grouping = grouped.lookupKey(terminal)
assert(
grouping.size == expectedSize,
- grouping.flatMap(_.asTarget: Option[Target[_]]).filter(important.contains) == OSet(terminal)
+ grouping.flatMap(_.asTarget: Option[Target[_]]).filter(important.contains) == Agg(terminal)
)
}
}
'singleton - check(singleton)(
_.single,
- OSet(_.single),
- OSet(singleton.single -> 1)
+ Agg(_.single),
+ Agg(singleton.single -> 1)
)
'pair - check(pair)(
_.down,
- OSet(_.up, _.down),
- OSet(pair.up -> 1, pair.down -> 1)
+ Agg(_.up, _.down),
+ Agg(pair.up -> 1, pair.down -> 1)
)
'anonTriple - check(anonTriple)(
_.down,
- OSet(_.up, _.down),
- OSet(anonTriple.up -> 1, anonTriple.down -> 2)
+ Agg(_.up, _.down),
+ Agg(anonTriple.up -> 1, anonTriple.down -> 2)
)
'diamond - check(diamond)(
_.down,
- OSet(_.up, _.left, _.right, _.down),
- OSet(
+ Agg(_.up, _.left, _.right, _.down),
+ Agg(
diamond.up -> 1,
diamond.left -> 1,
diamond.right -> 1,
@@ -120,8 +120,8 @@ object GraphTests extends TestSuite{
'defCachedDiamond - check(defCachedDiamond)(
_.down,
- OSet(_.up, _.left, _.right, _.down),
- OSet(
+ Agg(_.up, _.left, _.right, _.down),
+ Agg(
defCachedDiamond.up -> 2,
defCachedDiamond.left -> 2,
defCachedDiamond.right -> 2,
@@ -131,16 +131,16 @@ object GraphTests extends TestSuite{
'anonDiamond - check(anonDiamond)(
_.down,
- OSet(_.down, _.up),
- OSet(
+ Agg(_.down, _.up),
+ Agg(
anonDiamond.up -> 1,
anonDiamond.down -> 3
)
)
'bigSingleTerminal - check(bigSingleTerminal)(
_.j,
- OSet(_.a, _.b, _.e, _.f, _.i, _.j),
- OSet(
+ Agg(_.a, _.b, _.e, _.f, _.i, _.j),
+ Agg(
bigSingleTerminal.a -> 3,
bigSingleTerminal.b -> 2,
bigSingleTerminal.e -> 9,
@@ -154,7 +154,7 @@ object GraphTests extends TestSuite{
def countGroups(mapping: Discovered.Mapping[_], goals: Task[_]*) = {
val topoSorted = Graph.topoSorted(
- Graph.transitiveTargets(OSet.from(goals))
+ Graph.transitiveTargets(Agg.from(goals))
)
val grouped = Graph.groupAroundImportantTargets(topoSorted) {
case t: NamedTask[Any] => t
diff --git a/core/src/test/scala/mill/discover/ConsistencyTests.scala b/core/src/test/scala/mill/discover/ConsistencyTests.scala
index 4a9ae843..f29273df 100644
--- a/core/src/test/scala/mill/discover/ConsistencyTests.scala
+++ b/core/src/test/scala/mill/discover/ConsistencyTests.scala
@@ -4,7 +4,7 @@ package mill.discover
import mill.define.Segment.Label
import mill.define.Segments
import mill.util.{TestGraphs}
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import utest._
object ConsistencyTests extends TestSuite{
@@ -18,7 +18,7 @@ object ConsistencyTests extends TestSuite{
//
// Maybe later we can convert them into compile errors somehow
- val expected = OSet(
+ val expected = Agg(
Segments(Label("down")),
Segments(Label("right")),
Segments(Label("left")),
@@ -30,7 +30,7 @@ object ConsistencyTests extends TestSuite{
Discovered.mapping(diamond)
)
- assert(inconsistent == OSet())
+ assert(inconsistent == Agg())
}
'anonDiamond - {
@@ -38,7 +38,7 @@ object ConsistencyTests extends TestSuite{
Discovered.mapping(anonDiamond)
)
- assert(inconsistent == OSet())
+ assert(inconsistent == Agg())
}
'borkedCachedDiamond2 - {
diff --git a/core/src/test/scala/mill/eval/EvaluationTests.scala b/core/src/test/scala/mill/eval/EvaluationTests.scala
index 2b9dd102..31ae5ab9 100644
--- a/core/src/test/scala/mill/eval/EvaluationTests.scala
+++ b/core/src/test/scala/mill/eval/EvaluationTests.scala
@@ -7,7 +7,7 @@ import mill.{Module, T}
import mill.discover.Discovered
import mill.discover.Discovered.mapping
import mill.util.{DummyLogger, TestGraphs, TestUtil}
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import utest._
import utest.framework.TestPath
@@ -19,7 +19,7 @@ object EvaluationTests extends TestSuite{
def evaluator = new Evaluator(workspace, ammonite.ops.pwd, mapping, DummyLogger)
def apply(target: Task[_], expValue: Any,
- expEvaled: OSet[Task[_]],
+ expEvaled: Agg[Task[_]],
// How many "other" tasks were evaluated other than those listed above.
// Pass in -1 to skip the check entirely
extraEvaled: Int = 0,
@@ -28,7 +28,7 @@ object EvaluationTests extends TestSuite{
// are directly evaluating tasks which need to re-evaluate every time
secondRunNoOp: Boolean = true) = {
- val evaled = evaluator.evaluate(OSet(target))
+ val evaled = evaluator.evaluate(Agg(target))
val (matchingReturnedEvaled, extra) = evaled.evaluated.indexed.partition(expEvaled.contains)
@@ -40,8 +40,8 @@ object EvaluationTests extends TestSuite{
// Second time the value is already cached, so no evaluation needed
if (secondRunNoOp){
- val evaled2 = evaluator.evaluate(OSet(target))
- val expecteSecondRunEvaluated = OSet()
+ val evaled2 = evaluator.evaluate(Agg(target))
+ val expecteSecondRunEvaluated = Agg()
assert(
evaled2.values == evaled.values,
evaled2.evaluated == expecteSecondRunEvaluated
@@ -61,94 +61,94 @@ object EvaluationTests extends TestSuite{
import singleton._
val check = new Checker(mapping(singleton))
// First time the target is evaluated
- check(single, expValue = 0, expEvaled = OSet(single))
+ check(single, expValue = 0, expEvaled = Agg(single))
single.counter += 1
// After incrementing the counter, it forces re-evaluation
- check(single, expValue = 1, expEvaled = OSet(single))
+ check(single, expValue = 1, expEvaled = Agg(single))
}
'pair - {
import pair._
val check = new Checker(mapping(pair))
- check(down, expValue = 0, expEvaled = OSet(up, down))
+ check(down, expValue = 0, expEvaled = Agg(up, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = OSet(down))
+ check(down, expValue = 1, expEvaled = Agg(down))
up.counter += 1
- check(down, expValue = 2, expEvaled = OSet(up, down))
+ check(down, expValue = 2, expEvaled = Agg(up, down))
}
'anonTriple - {
import anonTriple._
val check = new Checker(mapping(anonTriple))
val middle = down.inputs(0)
- check(down, expValue = 0, expEvaled = OSet(up, middle, down))
+ check(down, expValue = 0, expEvaled = Agg(up, middle, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = OSet(middle, down))
+ check(down, expValue = 1, expEvaled = Agg(middle, down))
up.counter += 1
- check(down, expValue = 2, expEvaled = OSet(up, middle, down))
+ check(down, expValue = 2, expEvaled = Agg(up, middle, down))
middle.asInstanceOf[TestUtil.Test].counter += 1
- check(down, expValue = 3, expEvaled = OSet(middle, down))
+ check(down, expValue = 3, expEvaled = Agg(middle, down))
}
'diamond - {
import diamond._
val check = new Checker(mapping(diamond))
- check(down, expValue = 0, expEvaled = OSet(up, left, right, down))
+ check(down, expValue = 0, expEvaled = Agg(up, left, right, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = OSet(down))
+ check(down, expValue = 1, expEvaled = Agg(down))
up.counter += 1
// Increment by 2 because up is referenced twice: once by left once by right
- check(down, expValue = 3, expEvaled = OSet(up, left, right, down))
+ check(down, expValue = 3, expEvaled = Agg(up, left, right, down))
left.counter += 1
- check(down, expValue = 4, expEvaled = OSet(left, down))
+ check(down, expValue = 4, expEvaled = Agg(left, down))
right.counter += 1
- check(down, expValue = 5, expEvaled = OSet(right, down))
+ check(down, expValue = 5, expEvaled = Agg(right, down))
}
'anonDiamond - {
import anonDiamond._
val check = new Checker(mapping(anonDiamond))
val left = down.inputs(0).asInstanceOf[TestUtil.Test]
val right = down.inputs(1).asInstanceOf[TestUtil.Test]
- check(down, expValue = 0, expEvaled = OSet(up, left, right, down))
+ check(down, expValue = 0, expEvaled = Agg(up, left, right, down))
down.counter += 1
- check(down, expValue = 1, expEvaled = OSet(left, right, down))
+ check(down, expValue = 1, expEvaled = Agg(left, right, down))
up.counter += 1
// Increment by 2 because up is referenced twice: once by left once by right
- check(down, expValue = 3, expEvaled = OSet(up, left, right, down))
+ check(down, expValue = 3, expEvaled = Agg(up, left, right, down))
left.counter += 1
- check(down, expValue = 4, expEvaled = OSet(left, right, down))
+ check(down, expValue = 4, expEvaled = Agg(left, right, down))
right.counter += 1
- check(down, expValue = 5, expEvaled = OSet(left, right, down))
+ check(down, expValue = 5, expEvaled = Agg(left, right, down))
}
'bigSingleTerminal - {
import bigSingleTerminal._
val check = new Checker(mapping(bigSingleTerminal))
- check(j, expValue = 0, expEvaled = OSet(a, b, e, f, i, j), extraEvaled = 22)
+ check(j, expValue = 0, expEvaled = Agg(a, b, e, f, i, j), extraEvaled = 22)
j.counter += 1
- check(j, expValue = 1, expEvaled = OSet(j), extraEvaled = 3)
+ check(j, expValue = 1, expEvaled = Agg(j), extraEvaled = 3)
i.counter += 1
// increment value by 2 because `i` is used twice on the way to `j`
- check(j, expValue = 3, expEvaled = OSet(j, i), extraEvaled = 8)
+ check(j, expValue = 3, expEvaled = Agg(j, i), extraEvaled = 8)
b.counter += 1
// increment value by 4 because `b` is used four times on the way to `j`
- check(j, expValue = 7, expEvaled = OSet(b, e, f, i, j), extraEvaled = 20)
+ check(j, expValue = 7, expEvaled = Agg(b, e, f, i, j), extraEvaled = 20)
}
}
@@ -159,16 +159,16 @@ object EvaluationTests extends TestSuite{
import separateGroups._
val checker = new Checker(mapping(separateGroups))
- val evaled1 = checker.evaluator.evaluate(OSet(right, left))
+ val evaled1 = checker.evaluator.evaluate(Agg(right, left))
val filtered1 = evaled1.evaluated.filter(_.isInstanceOf[Target[_]])
- assert(filtered1 == OSet(change, left, right))
- val evaled2 = checker.evaluator.evaluate(OSet(right, left))
+ assert(filtered1 == Agg(change, left, right))
+ val evaled2 = checker.evaluator.evaluate(Agg(right, left))
val filtered2 = evaled2.evaluated.filter(_.isInstanceOf[Target[_]])
- assert(filtered2 == OSet())
+ assert(filtered2 == Agg())
change.counter += 1
- val evaled3 = checker.evaluator.evaluate(OSet(right, left))
+ val evaled3 = checker.evaluator.evaluate(Agg(right, left))
val filtered3 = evaled3.evaluated.filter(_.isInstanceOf[Target[_]])
- assert(filtered3 == OSet(change, right))
+ assert(filtered3 == Agg(change, right))
}
@@ -176,16 +176,16 @@ object EvaluationTests extends TestSuite{
import triangleTask._
val checker = new Checker(mapping(triangleTask))
- checker(right, 3, OSet(left, right), extraEvaled = -1)
- checker(left, 1, OSet(), extraEvaled = -1)
+ checker(right, 3, Agg(left, right), extraEvaled = -1)
+ checker(left, 1, Agg(), extraEvaled = -1)
}
'multiTerminalGroup - {
import multiTerminalGroup._
val checker = new Checker(mapping(multiTerminalGroup))
- checker(right, 1, OSet(right), extraEvaled = -1)
- checker(left, 1, OSet(left), extraEvaled = -1)
+ checker(right, 1, Agg(right), extraEvaled = -1)
+ checker(left, 1, Agg(left), extraEvaled = -1)
}
'multiTerminalBoundary - {
@@ -193,15 +193,15 @@ object EvaluationTests extends TestSuite{
import multiTerminalBoundary._
val checker = new Checker(mapping(multiTerminalBoundary))
- checker(task2, 4, OSet(right, left), extraEvaled = -1, secondRunNoOp = false)
- checker(task2, 4, OSet(), extraEvaled = -1, secondRunNoOp = false)
+ checker(task2, 4, Agg(right, left), extraEvaled = -1, secondRunNoOp = false)
+ checker(task2, 4, Agg(), extraEvaled = -1, secondRunNoOp = false)
}
'overrideSuperTask - {
import canOverrideSuper._
val checker = new Checker(mapping(canOverrideSuper))
- checker(foo, Seq("base", "object"), OSet(foo), extraEvaled = -1)
+ checker(foo, Seq("base", "object"), Agg(foo), extraEvaled = -1)
}
'tasksAreUncached - {
@@ -239,12 +239,12 @@ object EvaluationTests extends TestSuite{
// cached target
val check = new Checker(mapping(build))
assert(leftCount == 0, rightCount == 0)
- check(down, expValue = 10101, expEvaled = OSet(up, right, down), extraEvaled = 8)
+ check(down, expValue = 10101, expEvaled = Agg(up, right, down), extraEvaled = 8)
assert(leftCount == 1, middleCount == 1, rightCount == 1)
// If the upstream `up` doesn't change, the entire block of tasks
// doesn't need to recompute
- check(down, expValue = 10101, expEvaled = OSet())
+ check(down, expValue = 10101, expEvaled = Agg())
assert(leftCount == 1, middleCount == 1, rightCount == 1)
// But if `up` changes, the entire block of downstream tasks needs to
@@ -252,19 +252,19 @@ object EvaluationTests extends TestSuite{
// because tasks have no cached value that can be used. `right`, which
// is a cached Target, does not recompute
up.inputs(0).asInstanceOf[Test].counter += 1
- check(down, expValue = 10102, expEvaled = OSet(up, down), extraEvaled = 6)
+ check(down, expValue = 10102, expEvaled = Agg(up, down), extraEvaled = 6)
assert(leftCount == 2, middleCount == 2, rightCount == 1)
// Running the tasks themselves results in them being recomputed every
// single time, even if nothing changes
- check(left, expValue = 2, expEvaled = OSet(), extraEvaled = 1, secondRunNoOp = false)
+ check(left, expValue = 2, expEvaled = Agg(), extraEvaled = 1, secondRunNoOp = false)
assert(leftCount == 3, middleCount == 2, rightCount == 1)
- check(left, expValue = 2, expEvaled = OSet(), extraEvaled = 1, secondRunNoOp = false)
+ check(left, expValue = 2, expEvaled = Agg(), extraEvaled = 1, secondRunNoOp = false)
assert(leftCount == 4, middleCount == 2, rightCount == 1)
- check(middle, expValue = 100, expEvaled = OSet(), extraEvaled = 2, secondRunNoOp = false)
+ check(middle, expValue = 100, expEvaled = Agg(), extraEvaled = 2, secondRunNoOp = false)
assert(leftCount == 4, middleCount == 3, rightCount == 1)
- check(middle, expValue = 100, expEvaled = OSet(), extraEvaled = 2, secondRunNoOp = false)
+ check(middle, expValue = 100, expEvaled = Agg(), extraEvaled = 2, secondRunNoOp = false)
assert(leftCount == 4, middleCount == 4, rightCount == 1)
}
}
diff --git a/core/src/test/scala/mill/eval/FailureTests.scala b/core/src/test/scala/mill/eval/FailureTests.scala
index ef206740..c1ca1533 100644
--- a/core/src/test/scala/mill/eval/FailureTests.scala
+++ b/core/src/test/scala/mill/eval/FailureTests.scala
@@ -4,7 +4,7 @@ import mill.define.Target
import mill.discover.Discovered
import mill.discover.Discovered.mapping
import mill.util.DummyLogger
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import utest._
import utest.framework.TestPath
@@ -19,7 +19,7 @@ object FailureTests extends TestSuite{
def apply(target: Target[_], expectedFailCount: Int, expectedRawValues: Seq[Result[_]]) = {
- val res = evaluator.evaluate(OSet(target))
+ val res = evaluator.evaluate(Agg(target))
val cleaned = res.rawValues.map{
case Result.Exception(ex, _) => Result.Exception(ex, Nil)
diff --git a/core/src/test/scala/mill/eval/JavaCompileJarTests.scala b/core/src/test/scala/mill/eval/JavaCompileJarTests.scala
index 8105f2fa..f40fb798 100644
--- a/core/src/test/scala/mill/eval/JavaCompileJarTests.scala
+++ b/core/src/test/scala/mill/eval/JavaCompileJarTests.scala
@@ -8,7 +8,7 @@ import mill.modules.Jvm
import mill.util.Ctx.DestCtx
import mill.{Module, T}
import mill.util.{DummyLogger, Loose, TestUtil}
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import utest._
import mill._
@@ -41,7 +41,7 @@ object JavaCompileJarTests extends TestSuite{
def resourceRoot = T.source{ resourceRootPath }
def allSources = T{ ls.rec(sourceRoot().path).map(PathRef(_)) }
def classFiles = T{ compileAll(allSources()) }
- def jar = T{ Jvm.createJar(Loose.OSet(resourceRoot().path, classFiles().path)) }
+ def jar = T{ Jvm.createJar(Loose.Agg(resourceRoot().path, classFiles().path)) }
def run(mainClsName: String) = T.command{
%%('java, "-cp", classFiles().path, mainClsName)
@@ -53,7 +53,7 @@ object JavaCompileJarTests extends TestSuite{
def eval[T](t: Task[T]) = {
val evaluator = new Evaluator(workspacePath, pwd, mapping, DummyLogger)
- val evaluated = evaluator.evaluate(OSet(t))
+ val evaluated = evaluator.evaluate(Agg(t))
if (evaluated.failing.keyCount == 0){
Right(Tuple2(
@@ -68,7 +68,7 @@ object JavaCompileJarTests extends TestSuite{
}
}
- def check(targets: OSet[Task[_]], expected: OSet[Task[_]]) = {
+ def check(targets: Agg[Task[_]], expected: Agg[Task[_]]) = {
val evaluator = new Evaluator(workspacePath, pwd, mapping, DummyLogger)
val evaluated = evaluator.evaluate(targets)
@@ -83,47 +83,47 @@ object JavaCompileJarTests extends TestSuite{
check(
- targets = OSet(jar),
- expected = OSet(allSources, classFiles, jar)
+ targets = Agg(jar),
+ expected = Agg(allSources, classFiles, jar)
)
// Re-running with no changes results in nothing being evaluated
- check(targets = OSet(jar), expected = OSet())
+ check(targets = Agg(jar), expected = Agg())
// Appending an empty string gets ignored due to file-content hashing
append(sourceRootPath / "Foo.java", "")
- check(targets = OSet(jar), expected = OSet())
+ check(targets = Agg(jar), expected = Agg())
// Appending whitespace forces a recompile, but the classfilesend up
// exactly the same so no re-jarring.
append(sourceRootPath / "Foo.java", " ")
// Note that `sourceRoot` and `resourceRoot` never turn up in the `expected`
// list, because they are `Source`s not `Target`s
- check(targets = OSet(jar), expected = OSet(/*sourceRoot, */allSources, classFiles))
+ check(targets = Agg(jar), expected = Agg(/*sourceRoot, */allSources, classFiles))
// Appending a new class changes the classfiles, which forces us to
// re-create the final jar
append(sourceRootPath / "Foo.java", "\nclass FooTwo{}")
- check(targets = OSet(jar), expected = OSet(allSources, classFiles, jar))
+ check(targets = Agg(jar), expected = Agg(allSources, classFiles, jar))
// Tweaking the resources forces rebuild of the final jar, without
// recompiling classfiles
append(resourceRootPath / "hello.txt", " ")
- check(targets = OSet(jar), expected = OSet(jar))
+ check(targets = Agg(jar), expected = Agg(jar))
// Asking for an intermediate target forces things to be build up to that
// target only; these are re-used for any downstream targets requested
append(sourceRootPath / "Bar.java", "\nclass BarTwo{}")
append(resourceRootPath / "hello.txt", " ")
- check(targets = OSet(classFiles), expected = OSet(allSources, classFiles))
- check(targets = OSet(jar), expected = OSet(jar))
- check(targets = OSet(allSources), expected = OSet())
+ check(targets = Agg(classFiles), expected = Agg(allSources, classFiles))
+ check(targets = Agg(jar), expected = Agg(jar))
+ check(targets = Agg(allSources), expected = Agg())
append(sourceRootPath / "Bar.java", "\nclass BarThree{}")
append(resourceRootPath / "hello.txt", " ")
- check(targets = OSet(resourceRoot), expected = OSet())
- check(targets = OSet(allSources), expected = OSet(allSources))
- check(targets = OSet(jar), expected = OSet(classFiles, jar))
+ check(targets = Agg(resourceRoot), expected = Agg())
+ check(targets = Agg(allSources), expected = Agg(allSources))
+ check(targets = Agg(jar), expected = Agg(classFiles, jar))
val jarContents = %%('jar, "-tf", workspacePath/'jar/'dest)(workspacePath).out.string
val expectedJarContents =
diff --git a/core/src/test/scala/mill/util/TestEvaluator.scala b/core/src/test/scala/mill/util/TestEvaluator.scala
index 3f6086ba..be486d4d 100644
--- a/core/src/test/scala/mill/util/TestEvaluator.scala
+++ b/core/src/test/scala/mill/util/TestEvaluator.scala
@@ -4,14 +4,14 @@ import ammonite.ops.Path
import mill.define.{Input, Target, Task}
import mill.discover.{Discovered, Mirror}
import mill.eval.{Evaluator, Result}
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
class TestEvaluator(mapping: Discovered.Mapping[_],
workspacePath: Path,
basePath: Path){
val evaluator = new Evaluator(workspacePath, basePath, mapping, DummyLogger)
def apply[T](t: Task[T]): Either[Result.Failing, (T, Int)] = {
- val evaluated = evaluator.evaluate(OSet(t))
+ val evaluated = evaluator.evaluate(Agg(t))
if (evaluated.failing.keyCount == 0) {
Right(
diff --git a/core/src/test/scala/mill/util/TestUtil.scala b/core/src/test/scala/mill/util/TestUtil.scala
index 3cc945db..ca6097a1 100644
--- a/core/src/test/scala/mill/util/TestUtil.scala
+++ b/core/src/test/scala/mill/util/TestUtil.scala
@@ -4,7 +4,7 @@ import ammonite.main.Router.Overrides
import mill.define._
import mill.eval.Result
import utest.assert
-import mill.util.Strict.OSet
+import mill.util.Strict.Agg
import scala.collection.mutable
object TestUtil {
@@ -56,7 +56,7 @@ object TestUtil {
}
- def checkTopological(targets: OSet[Task[_]]) = {
+ def checkTopological(targets: Agg[Task[_]]) = {
val seen = mutable.Set.empty[Task[_]]
for(t <- targets.indexed.reverseIterator){
seen.add(t)