diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/test/src/define/ApplicativeTests.scala | 38 | ||||
-rw-r--r-- | main/test/src/define/BasePathTests.scala | 20 | ||||
-rw-r--r-- | main/test/src/define/CacherTests.scala | 12 | ||||
-rw-r--r-- | main/test/src/define/DiscoverTests.scala | 16 | ||||
-rw-r--r-- | main/test/src/define/GraphTests.scala | 46 | ||||
-rw-r--r-- | main/test/src/define/MacroErrorTests.scala | 24 | ||||
-rw-r--r-- | main/test/src/eval/CrossTests.scala | 8 | ||||
-rw-r--r-- | main/test/src/eval/EvaluationTests.scala | 38 | ||||
-rw-r--r-- | main/test/src/eval/FailureTests.scala | 8 | ||||
-rw-r--r-- | main/test/src/eval/JavaCompileJarTests.scala | 2 | ||||
-rw-r--r-- | main/test/src/eval/ModuleTests.scala | 4 | ||||
-rw-r--r-- | main/test/src/eval/TarjanTests.scala | 24 | ||||
-rw-r--r-- | main/test/src/eval/TaskTests.scala | 6 | ||||
-rw-r--r-- | main/test/src/main/ClientServerTests.scala | 4 | ||||
-rw-r--r-- | main/test/src/main/ForeignBuildsTest.scala | 2 | ||||
-rw-r--r-- | main/test/src/main/ForeignConflictTest.scala | 2 | ||||
-rw-r--r-- | main/test/src/main/JavaCompileJarTests.scala | 2 | ||||
-rw-r--r-- | main/test/src/main/MainTests.scala | 124 | ||||
-rw-r--r-- | main/test/src/util/ParseArgsTest.scala | 60 |
19 files changed, 220 insertions, 220 deletions
diff --git a/main/test/src/define/ApplicativeTests.scala b/main/test/src/define/ApplicativeTests.scala index 9dd2132f..0f30a404 100644 --- a/main/test/src/define/ApplicativeTests.scala +++ b/main/test/src/define/ApplicativeTests.scala @@ -33,34 +33,34 @@ object ApplicativeTests extends TestSuite { val tests = Tests{ - 'selfContained - { + test("selfContained"){ - 'simple - assert(Opt("lol " + 1) == Some("lol 1")) - 'singleSome - assert(Opt("lol " + Some("hello")()) == Some("lol hello")) - 'twoSomes - assert(Opt(Some("lol ")() + Some("hello")()) == Some("lol hello")) - 'singleNone - assert(Opt("lol " + None()) == None) - 'twoNones - assert(Opt("lol " + None() + None()) == None) + test("simple") - assert(Opt("lol " + 1) == Some("lol 1")) + test("singleSome") - assert(Opt("lol " + Some("hello")()) == Some("lol hello")) + test("twoSomes") - assert(Opt(Some("lol ")() + Some("hello")()) == Some("lol hello")) + test("singleNone") - assert(Opt("lol " + None()) == None) + test("twoNones") - assert(Opt("lol " + None() + None()) == None) } - 'context - { + test("context"){ assert(Opt(Opt.ctx() + Some("World")()) == Some("hellooooWorld")) } - 'capturing - { + test("capturing"){ val lol = "lol " def hell(o: String) = "hell" + o - 'simple - assert(Opt(lol + 1) == Some("lol 1")) - 'singleSome - assert(Opt(lol + Some(hell("o"))()) == Some("lol hello")) - 'twoSomes - assert(Opt(Some(lol)() + Some(hell("o"))()) == Some("lol hello")) - 'singleNone - assert(Opt(lol + None()) == None) - 'twoNones - assert(Opt(lol + None() + None()) == None) + test("simple") - assert(Opt(lol + 1) == Some("lol 1")) + test("singleSome") - assert(Opt(lol + Some(hell("o"))()) == Some("lol hello")) + test("twoSomes") - assert(Opt(Some(lol)() + Some(hell("o"))()) == Some("lol hello")) + test("singleNone") - assert(Opt(lol + None()) == None) + test("twoNones") - assert(Opt(lol + None() + None()) == None) } - 'allowedLocalDef - { + test("allowedLocalDef"){ // Although x is defined inside the Opt{...} block, it is also defined // within the LHS of the Applyable#apply call, so it is safe to life it // out into the `zipMap` arguments list. val res = Opt{ "lol " + Some("hello").flatMap(x => Some(x)).apply() } assert(res == Some("lol hello")) } - 'upstreamAlwaysEvaluated - { + test("upstreamAlwaysEvaluated"){ // Whether or not control-flow reaches the Applyable#apply call inside an // Opt{...} block, we always evaluate the LHS of the Applyable#apply // because it gets lifted out of any control flow statements @@ -72,7 +72,7 @@ object ApplicativeTests extends TestSuite { counter.value == 1 ) } - 'upstreamEvaluatedOnlyOnce - { + test("upstreamEvaluatedOnlyOnce"){ // Even if control-flow reaches the Applyable#apply call more than once, // it only gets evaluated once due to its lifting out of the Opt{...} block val counter = new Counter() @@ -84,7 +84,7 @@ object ApplicativeTests extends TestSuite { counter.value == 1 ) } - 'evaluationsInsideLambdasWork - { + test("evaluationsInsideLambdasWork"){ // This required some fiddling with owner chains inside the macro to get // working, so ensure it doesn't regress val counter = new Counter() @@ -96,7 +96,7 @@ object ApplicativeTests extends TestSuite { down2 == Some(Seq("hello2", "hello2hello2", "hello2hello2hello2")) ) } - 'appliesEvaluatedOncePerLexicalCallsite - { + test("appliesEvaluatedOncePerLexicalCallsite"){ // If you have multiple Applyable#apply() lexically in the source code of // your Opt{...} call, each one gets evaluated once, even if the LHS of each // apply() call is identical. It's up to the downstream zipMap() @@ -106,7 +106,7 @@ object ApplicativeTests extends TestSuite { val down = Opt{ Seq(1, 2, 3).map(n => n + up() + up()) } assert(down == Some(Seq("1hello1hello2", "2hello1hello2", "3hello1hello2"))) } - 'appliesEvaluateBeforehand - { + test("appliesEvaluateBeforehand"){ // Every Applyable#apply() within a Opt{...} block evaluates before any // other logic within that block, even if they would happen first in the // normal Scala evaluation order diff --git a/main/test/src/define/BasePathTests.scala b/main/test/src/define/BasePathTests.scala index b8a653c8..e77c8d98 100644 --- a/main/test/src/define/BasePathTests.scala +++ b/main/test/src/define/BasePathTests.scala @@ -10,48 +10,48 @@ object BasePathTests extends TestSuite{ val remaining = f(m).millSourcePath.relativeTo(m.millSourcePath).segments assert(remaining == segments) } - 'singleton - { + test("singleton"){ check(testGraphs.singleton)(identity) } - 'backtickIdentifiers - { + test("backtickIdentifiers"){ check(testGraphs.bactickIdentifiers)( _.`nested-module`, "nested-module" ) } - 'separateGroups - { + test("separateGroups"){ check(TestGraphs.triangleTask)(identity) } - 'TraitWithModuleObject - { + test("TraitWithModuleObject"){ check(TestGraphs.TraitWithModuleObject)( _.TraitModule, "TraitModule" ) } - 'nestedModuleNested - { + test("nestedModuleNested"){ check(TestGraphs.nestedModule)(_.nested, "nested") } - 'nestedModuleInstance - { + test("nestedModuleInstance"){ check(TestGraphs.nestedModule)(_.classInstance, "classInstance") } - 'singleCross - { + test("singleCross"){ check(TestGraphs.singleCross)(_.cross, "cross") check(TestGraphs.singleCross)(_.cross("210"), "cross", "210") check(TestGraphs.singleCross)(_.cross("211"), "cross", "211") } - 'doubleCross - { + test("doubleCross"){ check(TestGraphs.doubleCross)(_.cross, "cross") check(TestGraphs.doubleCross)(_.cross("210", "jvm"), "cross", "210", "jvm") check(TestGraphs.doubleCross)(_.cross("212", "js"), "cross", "212", "js") } - 'nestedCrosses - { + test("nestedCrosses"){ check(TestGraphs.nestedCrosses)(_.cross, "cross") check(TestGraphs.nestedCrosses)( _.cross("210").cross2("js"), "cross", "210", "cross2", "js" ) } - 'overriden - { + test("overriden"){ object overridenBasePath extends TestUtil.BaseModule { override def millSourcePath = os.pwd / 'overridenBasePathRootValue object nested extends Module{ diff --git a/main/test/src/define/CacherTests.scala b/main/test/src/define/CacherTests.scala index 1524e5c1..882a8164 100644 --- a/main/test/src/define/CacherTests.scala +++ b/main/test/src/define/CacherTests.scala @@ -32,35 +32,35 @@ object CacherTests extends TestSuite{ } def check(x: Any, y: Any) = assert(x == y) - 'simpleDefIsCached - { + test("simpleDefIsCached"){ Predef.assert(Base.value eq Base.value) Predef.assert(eval(Base, Base.value) == 1) } - 'resultDefIsCached - { + test("resultDefIsCached"){ Predef.assert(Base.result eq Base.result) Predef.assert(eval(Base, Base.result) == 1) } - 'overridingDefIsAlsoCached - { + test("overridingDefIsAlsoCached"){ Predef.assert(eval(Middle, Middle.value) == 3) Predef.assert(Middle.value eq Middle.value) } - 'overridenDefRemainsAvailable - { + test("overridenDefRemainsAvailable"){ Predef.assert(eval(Middle, Middle.overriden) == 1) } - 'multipleOverridesWork- { + test("multipleOverridesWork"){ Predef.assert(eval(Terminal, Terminal.value) == 7) Predef.assert(eval(Terminal, Terminal.overriden) == 1) } // Doesn't fail, presumably compileError doesn't go far enough in the // compilation pipeline to hit the override checks // - // 'overrideOutsideModuleFails - { + // test("overrideOutsideModuleFails"){ // compileError(""" // trait Foo{ // def x = 1 diff --git a/main/test/src/define/DiscoverTests.scala b/main/test/src/define/DiscoverTests.scala index 248d6afe..b0c923fd 100644 --- a/main/test/src/define/DiscoverTests.scala +++ b/main/test/src/define/DiscoverTests.scala @@ -11,29 +11,29 @@ object DiscoverTests extends TestSuite{ val expected = targets.map(_(m)).toSet assert(discovered == expected) } - 'singleton - { + test("singleton"){ check(testGraphs.singleton)(_.single) } - 'backtickIdentifiers { + test("backtickIdentifiers"){ check(testGraphs.bactickIdentifiers)(_.`up-target`, _.`a-down-target`, _.`nested-module`.`nested-target`) } - 'separateGroups - { + test("separateGroups"){ check(TestGraphs.triangleTask)(_.left, _.right) } - 'TraitWithModuleObject - { + test("TraitWithModuleObject"){ check(TestGraphs.TraitWithModuleObject)(_.TraitModule.testFrameworks) } - 'nestedModule - { + test("nestedModule"){ check(TestGraphs.nestedModule)(_.single, _.nested.single, _.classInstance.single) } - 'singleCross - { + test("singleCross"){ check(TestGraphs.singleCross)( _.cross("210").suffix, _.cross("211").suffix, _.cross("212").suffix ) } - 'doubleCross - { + test("doubleCross"){ check(TestGraphs.doubleCross)( _.cross("210", "jvm").suffix, _.cross("210", "js").suffix, @@ -44,7 +44,7 @@ object DiscoverTests extends TestSuite{ _.cross("212", "native").suffix ) } - 'nestedCrosses - { + test("nestedCrosses"){ check(TestGraphs.nestedCrosses)( _.cross("210").cross2("jvm").suffix, _.cross("210").cross2("js").suffix, diff --git a/main/test/src/define/GraphTests.scala b/main/test/src/define/GraphTests.scala index b36dbf95..17c9dcf2 100644 --- a/main/test/src/define/GraphTests.scala +++ b/main/test/src/define/GraphTests.scala @@ -14,34 +14,34 @@ object GraphTests extends TestSuite{ import graphs._ import TestGraphs._ - 'topoSortedTransitiveTargets - { + test("topoSortedTransitiveTargets"){ def check(targets: Agg[Task[_]], expected: Agg[Task[_]]) = { val result = Graph.topoSorted(Graph.transitiveTargets(targets)).values TestUtil.checkTopological(result) assert(result == expected) } - 'singleton - check( + test("singleton") - check( targets = Agg(singleton.single), expected = Agg(singleton.single) ) - 'backtickIdentifiers - check( + test("backtickIdentifiers") - check( targets = Agg(bactickIdentifiers.`a-down-target`), expected = Agg(bactickIdentifiers.`up-target`, bactickIdentifiers.`a-down-target`) ) - 'pair - check( + test("pair") - check( targets = Agg(pair.down), expected = Agg(pair.up, pair.down) ) - 'anonTriple - check( + test("anonTriple") - check( targets = Agg(anonTriple.down), expected = Agg(anonTriple.up, anonTriple.down.inputs(0), anonTriple.down) ) - 'diamond - check( + test("diamond") - check( targets = Agg(diamond.down), expected = Agg(diamond.up, diamond.left, diamond.right, diamond.down) ) - 'anonDiamond - check( + test("anonDiamond") - check( targets = Agg(diamond.down), expected = Agg( diamond.up, @@ -50,7 +50,7 @@ object GraphTests extends TestSuite{ diamond.down ) ) - 'defCachedDiamond - check( + test("defCachedDiamond") - check( targets = Agg(defCachedDiamond.down), expected = Agg( defCachedDiamond.up.inputs(0), @@ -63,14 +63,14 @@ object GraphTests extends TestSuite{ defCachedDiamond.down ) ) - 'bigSingleTerminal - { + test("bigSingleTerminal"){ val result = Graph.topoSorted(Graph.transitiveTargets(Agg(bigSingleTerminal.j))).values TestUtil.checkTopological(result) assert(result.size == 28) } } - 'groupAroundNamedTargets - { + test("groupAroundNamedTargets"){ def check[T, R <: Target[Int]](base: T) (target: T => R, important0: Agg[T => Target[_]], @@ -94,12 +94,12 @@ object GraphTests extends TestSuite{ } } - 'singleton - check(singleton)( + test("singleton") - check(singleton)( _.single, Agg(_.single), Agg(singleton.single -> 1) ) - 'backtickIdentifiers - check(bactickIdentifiers)( + test("backtickIdentifiers") - check(bactickIdentifiers)( _.`a-down-target`, Agg(_.`up-target`, _.`a-down-target`), Agg( @@ -107,17 +107,17 @@ object GraphTests extends TestSuite{ bactickIdentifiers.`a-down-target` -> 1 ) ) - 'pair - check(pair)( + test("pair") - check(pair)( _.down, Agg(_.up, _.down), Agg(pair.up -> 1, pair.down -> 1) ) - 'anonTriple - check(anonTriple)( + test("anonTriple") - check(anonTriple)( _.down, Agg(_.up, _.down), Agg(anonTriple.up -> 1, anonTriple.down -> 2) ) - 'diamond - check(diamond)( + test("diamond") - check(diamond)( _.down, Agg(_.up, _.left, _.right, _.down), Agg( @@ -128,7 +128,7 @@ object GraphTests extends TestSuite{ ) ) - 'defCachedDiamond - check(defCachedDiamond)( + test("defCachedDiamond") - check(defCachedDiamond)( _.down, Agg(_.up, _.left, _.right, _.down), Agg( @@ -139,7 +139,7 @@ object GraphTests extends TestSuite{ ) ) - 'anonDiamond - check(anonDiamond)( + test("anonDiamond") - check(anonDiamond)( _.down, Agg(_.down, _.up), Agg( @@ -147,7 +147,7 @@ object GraphTests extends TestSuite{ anonDiamond.down -> 3 ) ) - 'bigSingleTerminal - check(bigSingleTerminal)( + test("bigSingleTerminal") - check(bigSingleTerminal)( _.j, Agg(_.a, _.b, _.e, _.f, _.i, _.j), Agg( @@ -160,7 +160,7 @@ object GraphTests extends TestSuite{ ) ) } - 'multiTerminalGroupCounts - { + test("multiTerminalGroupCounts"){ def countGroups(goals: Task[_]*) = { val topoSorted = Graph.topoSorted( @@ -173,13 +173,13 @@ object GraphTests extends TestSuite{ grouped.keyCount } - 'separateGroups - { + test("separateGroups"){ import separateGroups._ val groupCount = countGroups(right, left) assert(groupCount == 3) } - 'triangleTask - { + test("triangleTask"){ // Make sure the following graph ends up as a single group, since although // `right` depends on `left`, both of them depend on the un-cached `task` // which would force them both to re-compute every time `task` changes @@ -189,7 +189,7 @@ object GraphTests extends TestSuite{ } - 'multiTerminalGroup - { + test("multiTerminalGroup"){ // Make sure the following graph ends up as two groups import multiTerminalGroup._ val groupCount = countGroups(right, left) @@ -197,7 +197,7 @@ object GraphTests extends TestSuite{ } - 'multiTerminalBoundary - { + test("multiTerminalBoundary"){ // Make sure the following graph ends up as a three groups: one for // each cached target, and one for the downstream task we are running import multiTerminalBoundary._ diff --git a/main/test/src/define/MacroErrorTests.scala b/main/test/src/define/MacroErrorTests.scala index c8b140fa..a52f4ad6 100644 --- a/main/test/src/define/MacroErrorTests.scala +++ b/main/test/src/define/MacroErrorTests.scala @@ -7,7 +7,7 @@ object MacroErrorTests extends TestSuite{ val tests = Tests{ - 'errors{ + test("errors"){ val expectedMsg = "T{} members must be defs defined in a Cacher class/trait/object body" @@ -15,8 +15,8 @@ object MacroErrorTests extends TestSuite{ assert(err.msg == expectedMsg) } - 'badParameterSets - { - 'command - { + test("badParameterSets"){ + test("command"){ val e = compileError(""" object foo extends mill.util.TestUtil.BaseModule{ def w = T.command{1} @@ -28,7 +28,7 @@ object MacroErrorTests extends TestSuite{ e.pos.contains("def w = ") ) } - 'target - { + test("target"){ val e = compileError(""" object foo extends mill.util.TestUtil.BaseModule{ def x() = T{1} @@ -40,7 +40,7 @@ object MacroErrorTests extends TestSuite{ e.pos.contains("def x() = ") ) } - 'input - { + test("input"){ val e = compileError(""" object foo extends mill.util.TestUtil.BaseModule{ def y() = T.input{1} @@ -52,7 +52,7 @@ object MacroErrorTests extends TestSuite{ e.pos.contains("def y() = ") ) } - 'sources - { + test("sources"){ val e = compileError(""" object foo extends mill.util.TestUtil.BaseModule{ def z() = T.sources{ammonite.ops.pwd} @@ -64,7 +64,7 @@ object MacroErrorTests extends TestSuite{ e.pos.contains("def z() = ") ) } - 'persistent - { + test("persistent"){ val e = compileError(""" object foo extends mill.util.TestUtil.BaseModule{ def a() = T.persistent{1} @@ -77,11 +77,11 @@ object MacroErrorTests extends TestSuite{ ) } } - 'badTmacro - { + test("badTmacro"){ // Make sure we can reference values from outside the T{...} block as part // of our `Target#apply()` calls, but we cannot reference any values that // come from inside the T{...} block - 'pos - { + test("pos"){ val e = compileError(""" val a = T{ 1 } val arr = Array(a) @@ -96,7 +96,7 @@ object MacroErrorTests extends TestSuite{ "Modules, Targets and Commands can only be defined within a mill Module") ) } - 'neg - { + test("neg"){ val expectedMsg = "Target#apply() call cannot use `value n` defined within the T{...} block" @@ -112,7 +112,7 @@ object MacroErrorTests extends TestSuite{ }""") assert(err.msg == expectedMsg) } - 'neg2 - { + test("neg2"){ val expectedMsg = "Target#apply() call cannot use `value x` defined within the T{...} block" @@ -127,7 +127,7 @@ object MacroErrorTests extends TestSuite{ }""") assert(err.msg == expectedMsg) } - 'neg3{ + test("neg3"){ val borkedCachedDiamond1 = utest.compileError(""" object borkedCachedDiamond1 { def up = T{ TestUtil.test() } diff --git a/main/test/src/eval/CrossTests.scala b/main/test/src/eval/CrossTests.scala index f194924e..d3dd956c 100644 --- a/main/test/src/eval/CrossTests.scala +++ b/main/test/src/eval/CrossTests.scala @@ -8,7 +8,7 @@ import mill.util.TestGraphs.{crossResolved, doubleCross, nestedCrosses, singleCr import utest._ object CrossTests extends TestSuite{ val tests = Tests{ - 'singleCross - { + test("singleCross"){ val check = new TestEvaluator(singleCross) val Right(("210", 1)) = check.apply(singleCross.cross("210").suffix) @@ -16,7 +16,7 @@ object CrossTests extends TestSuite{ val Right(("212", 1)) = check.apply(singleCross.cross("212").suffix) } - 'crossResolved - { + test("crossResolved"){ val check = new TestEvaluator(crossResolved) val Right(("2.10", 1)) = check.apply(crossResolved.foo("2.10").suffix) @@ -29,7 +29,7 @@ object CrossTests extends TestSuite{ } - 'doubleCross - { + test("doubleCross"){ val check = new TestEvaluator(doubleCross) val Right(("210_jvm", 1)) = check.apply(doubleCross.cross("210", "jvm").suffix) @@ -41,7 +41,7 @@ object CrossTests extends TestSuite{ val Right(("212_native", 1)) = check.apply(doubleCross.cross("212", "native").suffix) } - 'nestedCrosses - { + test("nestedCrosses"){ val check = new TestEvaluator(nestedCrosses) val Right(("210_jvm", 1)) = check.apply(nestedCrosses.cross("210").cross2("jvm").suffix) diff --git a/main/test/src/eval/EvaluationTests.scala b/main/test/src/eval/EvaluationTests.scala index 7f924db2..abf394d5 100644 --- a/main/test/src/eval/EvaluationTests.scala +++ b/main/test/src/eval/EvaluationTests.scala @@ -1,7 +1,7 @@ package mill.eval -import mill.util.TestUtil.{Test, test} +import mill.util.TestUtil.Test import mill.define.{Discover, Graph, Target, Task} import mill.{Module, T} import mill.util.{DummyLogger, TestEvaluator, TestGraphs, TestUtil} @@ -55,9 +55,9 @@ object EvaluationTests extends TestSuite{ object graphs extends TestGraphs() import graphs._ import TestGraphs._ - 'evaluateSingle - { + test("evaluateSingle"){ - 'singleton - { + test("singleton"){ import singleton._ val check = new Checker(singleton) // First time the target is evaluated @@ -67,7 +67,7 @@ object EvaluationTests extends TestSuite{ // After incrementing the counter, it forces re-evaluation check(single, expValue = 1, expEvaled = Agg(single)) } - 'backtickIdentifiers - { + test("backtickIdentifiers"){ import graphs.bactickIdentifiers._ val check = new Checker(bactickIdentifiers) @@ -79,7 +79,7 @@ object EvaluationTests extends TestSuite{ `up-target`.counter += 1 check(`a-down-target`, expValue = 2, expEvaled = Agg(`up-target`, `a-down-target`)) } - 'pair - { + test("pair"){ import pair._ val check = new Checker(pair) check(down, expValue = 0, expEvaled = Agg(up, down)) @@ -90,7 +90,7 @@ object EvaluationTests extends TestSuite{ up.counter += 1 check(down, expValue = 2, expEvaled = Agg(up, down)) } - 'anonTriple - { + test("anonTriple"){ import anonTriple._ val check = new Checker(anonTriple) val middle = down.inputs(0) @@ -106,7 +106,7 @@ object EvaluationTests extends TestSuite{ check(down, expValue = 3, expEvaled = Agg(middle, down)) } - 'diamond - { + test("diamond"){ import diamond._ val check = new Checker(diamond) check(down, expValue = 0, expEvaled = Agg(up, left, right, down)) @@ -124,7 +124,7 @@ object EvaluationTests extends TestSuite{ right.counter += 1 check(down, expValue = 5, expEvaled = Agg(right, down)) } - 'anonDiamond - { + test("anonDiamond"){ import anonDiamond._ val check = new Checker(anonDiamond) val left = down.inputs(0).asInstanceOf[TestUtil.Test] @@ -145,7 +145,7 @@ object EvaluationTests extends TestSuite{ check(down, expValue = 5, expEvaled = Agg(left, right, down)) } - 'bigSingleTerminal - { + test("bigSingleTerminal"){ import bigSingleTerminal._ val check = new Checker(bigSingleTerminal) @@ -164,8 +164,8 @@ object EvaluationTests extends TestSuite{ } } - 'evaluateMixed - { - 'separateGroups - { + test("evaluateMixed"){ + test("separateGroups"){ // Make sure that `left` and `right` are able to recompute separately, // even though one depends on the other @@ -184,7 +184,7 @@ object EvaluationTests extends TestSuite{ } - 'triangleTask - { + test("triangleTask"){ import triangleTask._ val checker = new Checker(triangleTask) @@ -192,7 +192,7 @@ object EvaluationTests extends TestSuite{ checker(left, 1, Agg(), extraEvaled = -1) } - 'multiTerminalGroup - { + test("multiTerminalGroup"){ import multiTerminalGroup._ val checker = new Checker(multiTerminalGroup) @@ -200,7 +200,7 @@ object EvaluationTests extends TestSuite{ checker(left, 1, Agg(left), extraEvaled = -1) } - 'multiTerminalBoundary - { + test("multiTerminalBoundary"){ import multiTerminalBoundary._ @@ -209,7 +209,7 @@ object EvaluationTests extends TestSuite{ checker(task2, 4, Agg(), extraEvaled = -1, secondRunNoOp = false) } - 'overrideSuperTask - { + test("overrideSuperTask"){ // Make sure you can override targets, call their supers, and have the // overriden target be allocated a spot within the overriden/ folder of // the main publically-available target @@ -231,7 +231,7 @@ object EvaluationTests extends TestSuite{ !overriden.contains("object") ) } - 'overrideSuperCommand - { + test("overrideSuperCommand"){ // Make sure you can override commands, call their supers, and have the // overriden command be allocated a spot within the overriden/ folder of // the main publically-available command @@ -259,7 +259,7 @@ object EvaluationTests extends TestSuite{ !overriden.contains("object1") ) } - 'nullTasks - { + test("nullTasks"){ import nullTasks._ val checker = new Checker(nullTasks) checker(nullTarget1, null, Agg(nullTarget1), extraEvaled = -1) @@ -286,7 +286,7 @@ object EvaluationTests extends TestSuite{ checker(nc4, null, Agg(nc4), extraEvaled = -1, secondRunNoOp = false) } - 'tasksAreUncached - { + test("tasksAreUncached"){ // Make sure the tasks `left` and `middle` re-compute every time, while // the target `right` does not // @@ -299,7 +299,7 @@ object EvaluationTests extends TestSuite{ var leftCount = 0 var rightCount = 0 var middleCount = 0 - def up = T{ test.anon() } + def up = T{ TestUtil.test.anon() } def left = T.task{ leftCount += 1; up() + 1 } def middle = T.task{ middleCount += 1; 100 } def right = T{ rightCount += 1; 10000 } diff --git a/main/test/src/eval/FailureTests.scala b/main/test/src/eval/FailureTests.scala index d1b3c750..eb1f51ef 100644 --- a/main/test/src/eval/FailureTests.scala +++ b/main/test/src/eval/FailureTests.scala @@ -12,7 +12,7 @@ object FailureTests extends TestSuite{ val graphs = new mill.util.TestGraphs() import graphs._ - 'evaluateSingle - { + test("evaluateSingle"){ val check = new TestEvaluator(singleton) check.fail( target = singleton.single, @@ -47,7 +47,7 @@ object FailureTests extends TestSuite{ expectedRawValues = Seq(Result.Exception(ex, new OuterStack(Nil))) ) } - 'evaluatePair - { + test("evaluatePair"){ val check = new TestEvaluator(pair) check.fail( pair.down, @@ -113,7 +113,7 @@ object FailureTests extends TestSuite{ ) } - 'evaluateBacktickIdentifiers - { + test("evaluateBacktickIdentifiers"){ val check = new TestEvaluator(bactickIdentifiers) import bactickIdentifiers._ check.fail( @@ -181,7 +181,7 @@ object FailureTests extends TestSuite{ ) } - 'multipleUsesOfDest - { + test("multipleUsesOfDest"){ object build extends TestUtil.BaseModule { // Using `T.ctx( ).dest` twice in a single task is ok def left = T{ + T.ctx().dest.toString.length + T.ctx().dest.toString.length } diff --git a/main/test/src/eval/JavaCompileJarTests.scala b/main/test/src/eval/JavaCompileJarTests.scala index 0f9002df..df6e3df5 100644 --- a/main/test/src/eval/JavaCompileJarTests.scala +++ b/main/test/src/eval/JavaCompileJarTests.scala @@ -18,7 +18,7 @@ object JavaCompileJarTests extends TestSuite{ } val tests = Tests{ - 'javac { + test("javac"){ val javacSrcPath = os.pwd / 'main / 'test / 'resources / 'examples / 'javac val javacDestPath = TestUtil.getOutPath() / 'src diff --git a/main/test/src/eval/ModuleTests.scala b/main/test/src/eval/ModuleTests.scala index f28fc9b6..2decd6a7 100644 --- a/main/test/src/eval/ModuleTests.scala +++ b/main/test/src/eval/ModuleTests.scala @@ -20,7 +20,7 @@ object ModuleTests extends TestSuite{ } val tests = Tests { os.remove.all(TestEvaluator.externalOutPath) - 'externalModuleTargetsAreNamespacedByModulePackagePath - { + test("externalModuleTargetsAreNamespacedByModulePackagePath"){ val check = new TestEvaluator(Build) val zresult = check.apply(Build.z) assert( @@ -30,7 +30,7 @@ object ModuleTests extends TestSuite{ os.read(TestEvaluator.externalOutPath / 'mill / 'eval / 'ModuleTests / 'ExternalModule / 'inner / 'y / "meta.json").contains("17") ) } - 'externalModuleMustBeGlobalStatic - { + test("externalModuleMustBeGlobalStatic"){ object Build extends mill.define.ExternalModule { diff --git a/main/test/src/eval/TarjanTests.scala b/main/test/src/eval/TarjanTests.scala index 2f9d0a4d..f430d013 100644 --- a/main/test/src/eval/TarjanTests.scala +++ b/main/test/src/eval/TarjanTests.scala @@ -10,40 +10,40 @@ object TarjanTests extends TestSuite{ } val tests = Tests{ // - 'empty - check(Seq(), Seq()) + test("empty") - check(Seq(), Seq()) // (0) - 'singleton - check(Seq(Seq()), Seq(Seq(0))) + test("singleton") - check(Seq(Seq()), Seq(Seq(0))) // (0)-. // ^._/ - 'selfCycle - check(Seq(Seq(0)), Seq(Seq(0))) + test("selfCycle") - check(Seq(Seq(0)), Seq(Seq(0))) // (0) <-> (1) - 'simpleCycle- check(Seq(Seq(1), Seq(0)), Seq(Seq(1, 0))) + test("simpleCycle") - check(Seq(Seq(1), Seq(0)), Seq(Seq(1, 0))) // (0) (1) (2) - 'multipleSingletons - check( + test("multipleSingletons") - check( Seq(Seq(), Seq(), Seq()), Seq(Seq(0), Seq(1), Seq(2)) ) // (0) -> (1) -> (2) - 'straightLineNoCycles- check( + test("straightLineNoCycles") - check( Seq(Seq(1), Seq(2), Seq()), Seq(Seq(2), Seq(1), Seq(0)) ) // (0) <- (1) <- (2) - 'straightLineNoCyclesReversed- check( + test("straightLineNoCyclesReversed") - check( Seq(Seq(), Seq(0), Seq(1)), Seq(Seq(0), Seq(1), Seq(2)) ) // (0) <-> (1) (2) -> (3) -> (4) // ^.____________/ - 'independentSimpleCycles - check( + test("independentSimpleCycles") - check( Seq(Seq(1), Seq(0), Seq(3), Seq(4), Seq(2)), Seq(Seq(1, 0), Seq(4, 3, 2)) ) @@ -52,7 +52,7 @@ object TarjanTests extends TestSuite{ // v \ // (0) <-> (1) (2) -> (3) -> (4) // ^.____________/ - 'independentLinkedCycles - check( + test("independentLinkedCycles") - check( Seq(Seq(1), Seq(0), Seq(3), Seq(4), Seq(2, 1)), Seq(Seq(1, 0), Seq(4, 3, 2)) ) @@ -60,7 +60,7 @@ object TarjanTests extends TestSuite{ // / v // (0) <-> (1) (2) -> (3) -> (4) // ^.____________/ - 'independentLinkedCycles2 - check( + test("independentLinkedCycles2") - check( Seq(Seq(1, 2), Seq(0), Seq(3), Seq(4), Seq(2)), Seq(Seq(4, 3, 2), Seq(1, 0)) ) @@ -70,7 +70,7 @@ object TarjanTests extends TestSuite{ // (0) <-> (1) (2) -> (3) -> (4) // ^. ^.____________/ // \________________/ - 'combinedCycles - check( + test("combinedCycles") - check( Seq(Seq(1, 2), Seq(0), Seq(3), Seq(4), Seq(2, 1)), Seq(Seq(4, 3, 2, 1, 0)) ) @@ -82,7 +82,7 @@ object TarjanTests extends TestSuite{ // / / // v / // (9) <--------' - 'combinedCycles - check( + test("combinedCycles") - check( Seq(Seq(1), Seq(0), Seq(0, 1), Seq(2, 4, 7, 9), Seq(3), Seq(4, 8), Seq(9), Seq(6), Seq(), Seq()), Seq(Seq(0, 1), Seq(2), Seq(9), Seq(6), Seq(7), Seq(3, 4), Seq(8), Seq(5)) ) diff --git a/main/test/src/eval/TaskTests.scala b/main/test/src/eval/TaskTests.scala index 0bfd8efc..8449a62f 100644 --- a/main/test/src/eval/TaskTests.scala +++ b/main/test/src/eval/TaskTests.scala @@ -53,7 +53,7 @@ object TaskTests extends TestSuite{ } } - 'inputs - { + test("inputs"){ // Inputs always re-evaluate, including forcing downstream cached Targets // to re-evaluate, but normal Tasks behind a Target run once then are cached val check = new TestEvaluator(build) @@ -67,7 +67,7 @@ object TaskTests extends TestSuite{ val Right((4, 0)) = check.apply(build.taskNoInput) } - 'persistent - { + test("persistent"){ // Persistent tasks keep the working dir around between runs val check = new TestEvaluator(build) val Right((1, 1)) = check.apply(build.persistent) @@ -79,7 +79,7 @@ object TaskTests extends TestSuite{ val Right((1, 1)) = check.apply(build.nonPersistent) } - 'worker - { + test("worker"){ // Persistent task def check = new TestEvaluator(build) diff --git a/main/test/src/main/ClientServerTests.scala b/main/test/src/main/ClientServerTests.scala index 6d918b30..dbc61060 100644 --- a/main/test/src/main/ClientServerTests.scala +++ b/main/test/src/main/ClientServerTests.scala @@ -80,7 +80,7 @@ object ClientServerTests extends TestSuite{ } def tests = Tests{ - 'hello - { + test("hello"){ if (!Util.isWindows){ val (tmpDir, locks) = init() def runClient(s: String) = runClientAux(tmpDir, locks)(Map.empty, Array(s)) @@ -135,7 +135,7 @@ object ClientServerTests extends TestSuite{ ) } - 'envVars - { + test("envVars"){ if (!Util.isWindows){ val (tmpDir, locks) = init() diff --git a/main/test/src/main/ForeignBuildsTest.scala b/main/test/src/main/ForeignBuildsTest.scala index cfc8d00c..461a34f0 100644 --- a/main/test/src/main/ForeignBuildsTest.scala +++ b/main/test/src/main/ForeignBuildsTest.scala @@ -11,7 +11,7 @@ object ForeignBuildsTest extends ScriptTestSuite(fork = false) { val tests = Tests { initWorkspace() - 'test - { + test("test"){ // See https://github.com/lihaoyi/mill/issues/302 if (!ammonite.util.Util.java9OrAbove) { assert( diff --git a/main/test/src/main/ForeignConflictTest.scala b/main/test/src/main/ForeignConflictTest.scala index a4352bb6..f18859fd 100644 --- a/main/test/src/main/ForeignConflictTest.scala +++ b/main/test/src/main/ForeignConflictTest.scala @@ -12,7 +12,7 @@ object ForeignConflictTest extends ScriptTestSuite(fork = false) { val tests = Tests { initWorkspace() - 'test - { + test("test"){ // see https://github.com/lihaoyi/mill/issues/302 if (!ammonite.util.Util.java9OrAbove) { assert( diff --git a/main/test/src/main/JavaCompileJarTests.scala b/main/test/src/main/JavaCompileJarTests.scala index 37c64b05..b069ad6c 100644 --- a/main/test/src/main/JavaCompileJarTests.scala +++ b/main/test/src/main/JavaCompileJarTests.scala @@ -8,7 +8,7 @@ object JavaCompileJarTests extends ScriptTestSuite(fork = false) { def scriptSourcePath = os.pwd / 'main / 'test / 'resources / 'examples / 'javac val tests = Tests{ initWorkspace() - 'test - { + test("test"){ if (!ammonite.util.Util.java9OrAbove) { // Basic target evaluation works assert(eval("classFiles")) diff --git a/main/test/src/main/MainTests.scala b/main/test/src/main/MainTests.scala index e836099c..b481adaa 100644 --- a/main/test/src/main/MainTests.scala +++ b/main/test/src/main/MainTests.scala @@ -23,76 +23,76 @@ object MainTests extends TestSuite{ val tests = Tests{ val graphs = new mill.util.TestGraphs() import graphs._ - 'single - { + test("single"){ val check = MainTests.check(singleton) _ - 'pos - check("single", Right(Seq(_.single))) - 'neg1 - check("sngle", Left("Cannot resolve sngle. Did you mean single?")) - 'neg2 - check("snigle", Left("Cannot resolve snigle. Did you mean single?")) - 'neg3 - check("nsiigle", Left("Cannot resolve nsiigle. Did you mean single?")) - 'neg4 - check("ansiigle", Left("Cannot resolve ansiigle. Try `mill resolve _` to see what's available.")) - 'neg5 - check("doesntExist", Left("Cannot resolve doesntExist. Try `mill resolve _` to see what's available.")) - 'neg6 - check("single.doesntExist", Left("Task single is not a module and has no children.")) - 'neg7 - check("", Left("Selector cannot be empty")) + test("pos") - check("single", Right(Seq(_.single))) + test("neg1") - check("sngle", Left("Cannot resolve sngle. Did you mean single?")) + test("neg2") - check("snigle", Left("Cannot resolve snigle. Did you mean single?")) + test("neg3") - check("nsiigle", Left("Cannot resolve nsiigle. Did you mean single?")) + test("neg4") - check("ansiigle", Left("Cannot resolve ansiigle. Try `mill resolve _` to see what's available.")) + test("neg5") - check("doesntExist", Left("Cannot resolve doesntExist. Try `mill resolve _` to see what's available.")) + test("neg6") - check("single.doesntExist", Left("Task single is not a module and has no children.")) + test("neg7") - check("", Left("Selector cannot be empty")) } - 'backtickIdentifiers - { + test("backtickIdentifiers"){ val check = MainTests.check(bactickIdentifiers) _ - 'pos1 - check("up-target", Right(Seq(_.`up-target`))) - 'pos2 - check("a-down-target", Right(Seq(_.`a-down-target`))) - 'neg1 - check("uptarget", Left("Cannot resolve uptarget. Did you mean up-target?")) - 'neg2 - check("upt-arget", Left("Cannot resolve upt-arget. Did you mean up-target?")) - 'neg3 - check("up-target.doesntExist", Left("Task up-target is not a module and has no children.")) - 'neg4 - check("", Left("Selector cannot be empty")) - 'neg5 - check("invisible&", Left("Cannot resolve invisible. Try `mill resolve _` to see what's available.")) - 'nested - { - 'pos - check("nested-module.nested-target", Right(Seq(_.`nested-module`.`nested-target`))) - 'neg - check("nested-module.doesntExist", Left("Cannot resolve nested-module.doesntExist. Try `mill resolve nested-module._` to see what's available.")) + test("pos1") - check("up-target", Right(Seq(_.`up-target`))) + test("pos2") - check("a-down-target", Right(Seq(_.`a-down-target`))) + test("neg1") - check("uptarget", Left("Cannot resolve uptarget. Did you mean up-target?")) + test("neg2") - check("upt-arget", Left("Cannot resolve upt-arget. Did you mean up-target?")) + test("neg3") - check("up-target.doesntExist", Left("Task up-target is not a module and has no children.")) + test("neg4") - check("", Left("Selector cannot be empty")) + test("neg5") - check("invisible&", Left("Cannot resolve invisible. Try `mill resolve _` to see what's available.")) + test("nested"){ + test("pos") - check("nested-module.nested-target", Right(Seq(_.`nested-module`.`nested-target`))) + test("neg") - check("nested-module.doesntExist", Left("Cannot resolve nested-module.doesntExist. Try `mill resolve nested-module._` to see what's available.")) } } - 'nested - { + test("nested"){ val check = MainTests.check(nestedModule) _ - 'pos1 - check("single", Right(Seq(_.single))) - 'pos2 - check("nested.single", Right(Seq(_.nested.single))) - 'pos3 - check("classInstance.single", Right(Seq(_.classInstance.single))) - 'neg1 - check( + test("pos1") - check("single", Right(Seq(_.single))) + test("pos2") - check("nested.single", Right(Seq(_.nested.single))) + test("pos3") - check("classInstance.single", Right(Seq(_.classInstance.single))) + test("neg1") - check( "doesntExist", Left("Cannot resolve doesntExist. Try `mill resolve _` to see what's available.") ) - 'neg2 - check( + test("neg2") - check( "single.doesntExist", Left("Task single is not a module and has no children.") ) - 'neg3 - check( + test("neg3") - check( "nested.doesntExist", Left("Cannot resolve nested.doesntExist. Try `mill resolve nested._` to see what's available.") ) - 'neg3 - check( + test("neg3") - check( "nested.singel", Left("Cannot resolve nested.singel. Did you mean nested.single?") ) - 'neg4 - check( + test("neg4") - check( "classInstance.doesntExist", Left("Cannot resolve classInstance.doesntExist. Try `mill resolve classInstance._` to see what's available.") ) - 'wildcard - check( + test("wildcard") - check( "_.single", Right(Seq( _.classInstance.single, _.nested.single )) ) - 'wildcardNeg - check( + test("wildcardNeg") - check( "_._.single", Left("Cannot resolve _._.single. Try `mill resolve _` to see what's available") ) - 'wildcardNeg2 - check( + test("wildcardNeg2") - check( "_._.__", Left("Cannot resolve _._.__. Try `mill resolve _` to see what's available") ) - 'wildcardNeg3 - check( + test("wildcardNeg3") - check( "nested._.foobar", Left("Cannot resolve nested._.foobar. Try `mill resolve nested._` to see what's available") ) - 'wildcard2 - check( + test("wildcard2") - check( "__.single", Right(Seq( _.single, @@ -101,7 +101,7 @@ object MainTests extends TestSuite{ )) ) - 'wildcard3 - check( + test("wildcard3") - check( "_.__.single", Right(Seq( _.classInstance.single, @@ -110,28 +110,28 @@ object MainTests extends TestSuite{ ) } - 'cross - { - 'single - { + test("cross"){ + test("single"){ val check = MainTests.check(singleCross) _ - 'pos1 - check("cross[210].suffix", Right(Seq(_.cross("210").suffix))) - 'pos2 - check("cross[211].suffix", Right(Seq(_.cross("211").suffix))) - 'neg1 - check( + test("pos1") - check("cross[210].suffix", Right(Seq(_.cross("210").suffix))) + test("pos2") - check("cross[211].suffix", Right(Seq(_.cross("211").suffix))) + test("neg1") - check( "cross[210].doesntExist", Left("Cannot resolve cross[210].doesntExist. Try `mill resolve cross[210]._` to see what's available.") ) - 'neg2 - check( + test("neg2") - check( "cross[doesntExist].doesntExist", Left("Cannot resolve cross[doesntExist]. Try `mill resolve cross[__]` to see what's available.") ) - 'neg3 - check( + test("neg3") - check( "cross[221].doesntExist", Left("Cannot resolve cross[221]. Did you mean cross[211]?") ) - 'neg4 - check( + test("neg4") - check( "cross[doesntExist].suffix", Left("Cannot resolve cross[doesntExist]. Try `mill resolve cross[__]` to see what's available.") ) - 'wildcard - check( + test("wildcard") - check( "cross[_].suffix", Right(Seq( _.cross("210").suffix, @@ -139,7 +139,7 @@ object MainTests extends TestSuite{ _.cross("212").suffix )) ) - 'wildcard2 - check( + test("wildcard2") - check( "cross[__].suffix", Right(Seq( _.cross("210").suffix, @@ -148,22 +148,22 @@ object MainTests extends TestSuite{ )) ) } - 'double - { + test("double"){ val check = MainTests.check(doubleCross) _ - 'pos1 - check( + test("pos1") - check( "cross[210,jvm].suffix", Right(Seq(_.cross("210", "jvm").suffix)) ) - 'pos2 - check( + test("pos2") - check( "cross[211,jvm].suffix", Right(Seq(_.cross("211", "jvm").suffix)) ) - 'wildcard - { - 'labelNeg - check( + test("wildcard"){ + test("labelNeg") - check( "_.suffix", Left("Cannot resolve _.suffix. Try `mill resolve _._` to see what's available.") ) - 'labelPos - check( + test("labelPos") - check( "__.suffix", Right(Seq( _.cross("210", "jvm").suffix, @@ -177,7 +177,7 @@ object MainTests extends TestSuite{ _.cross("212", "native").suffix )) ) - 'first - check( + test("first") - check( "cross[_,jvm].suffix", Right(Seq( _.cross("210", "jvm").suffix, @@ -185,14 +185,14 @@ object MainTests extends TestSuite{ _.cross("212", "jvm").suffix )) ) - 'second - check( + test("second") - check( "cross[210,_].suffix", Right(Seq( _.cross("210", "jvm").suffix, _.cross("210", "js").suffix )) ) - 'both - check( + test("both") - check( "cross[_,_].suffix", Right(Seq( _.cross("210", "jvm").suffix, @@ -206,7 +206,7 @@ object MainTests extends TestSuite{ _.cross("212", "native").suffix )) ) - 'both2 - check( + test("both2") - check( "cross[__].suffix", Right(Seq( _.cross("210", "jvm").suffix, @@ -222,18 +222,18 @@ object MainTests extends TestSuite{ ) } } - 'nested - { + test("nested"){ val check = MainTests.check(nestedCrosses) _ - 'pos1 - check( + test("pos1") - check( "cross[210].cross2[js].suffix", Right(Seq(_.cross("210").cross2("js").suffix)) ) - 'pos2 - check( + test("pos2") - check( "cross[211].cross2[jvm].suffix", Right(Seq(_.cross("211").cross2("jvm").suffix)) ) - 'wildcard - { - 'first - check( + test("wildcard"){ + test("first") - check( "cross[_].cross2[jvm].suffix", Right(Seq( _.cross("210").cross2("jvm").suffix, @@ -241,7 +241,7 @@ object MainTests extends TestSuite{ _.cross("212").cross2("jvm").suffix )) ) - 'second - check( + test("second") - check( "cross[210].cross2[_].suffix", Right(Seq( _.cross("210").cross2("jvm").suffix, @@ -249,7 +249,7 @@ object MainTests extends TestSuite{ _.cross("210").cross2("native").suffix )) ) - 'both - check( + test("both") - check( "cross[_].cross2[_].suffix", Right(Seq( _.cross("210").cross2("jvm").suffix, diff --git a/main/test/src/util/ParseArgsTest.scala b/main/test/src/util/ParseArgsTest.scala index e31baf4f..ca34b601 100644 --- a/main/test/src/util/ParseArgsTest.scala +++ b/main/test/src/util/ParseArgsTest.scala @@ -7,7 +7,7 @@ import utest._ object ParseArgsTest extends TestSuite { val tests = Tests { - 'extractSelsAndArgs - { + test("extractSelsAndArgs"){ def check(input: Seq[String], expectedSelectors: Seq[String], expectedArgs: Seq[String], @@ -20,41 +20,41 @@ object ParseArgsTest extends TestSuite { ) } - 'empty - check(input = Seq.empty, + test("empty") - check(input = Seq.empty, expectedSelectors = Seq.empty, expectedArgs = Seq.empty, multiSelect = false) - 'singleSelector - check( + test("singleSelector") - check( input = Seq("core.compile"), expectedSelectors = Seq("core.compile"), expectedArgs = Seq.empty, multiSelect = false ) - 'singleSelectorWithArgs - check( + test("singleSelectorWithArgs") - check( input = Seq("application.run", "hello", "world"), expectedSelectors = Seq("application.run"), expectedArgs = Seq("hello", "world"), multiSelect = false ) - 'singleSelectorWithAllInArgs - check( + test("singleSelectorWithAllInArgs") - check( input = Seq("application.run", "hello", "world", "--all"), expectedSelectors = Seq("application.run"), expectedArgs = Seq("hello", "world", "--all"), multiSelect = false ) - 'multiSelectors - check( + test("multiSelectors") - check( input = Seq("core.jar", "core.docJar", "core.sourcesJar"), expectedSelectors = Seq("core.jar", "core.docJar", "core.sourcesJar"), expectedArgs = Seq.empty, multiSelect = true ) - 'multiSelectorsSeq - check( + test("multiSelectorsSeq") - check( input = Seq("core.jar", "core.docJar", "core.sourcesJar"), expectedSelectors = Seq("core.jar", "core.docJar", "core.sourcesJar"), expectedArgs = Seq.empty, multiSelect = true ) - 'multiSelectorsWithArgs - check( + test("multiSelectorsWithArgs") - check( input = Seq("core.compile", "application.runMain", "--", @@ -65,7 +65,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq("Main", "hello", "world"), multiSelect = true ) - 'multiSelectorsWithArgsWithAllInArgs - check( + test("multiSelectorsWithArgsWithAllInArgs") - check( input = Seq("core.compile", "application.runMain", "--", @@ -77,22 +77,22 @@ object ParseArgsTest extends TestSuite { multiSelect = true ) } - 'expandBraces - { + test("expandBraces"){ def check(input: String, expectedExpansion: List[String]) = { val Right(expanded) = ParseArgs.expandBraces(input) assert(expanded == expectedExpansion) } - 'expandLeft - check( + test("expandLeft") - check( "{application,core}.compile", List("application.compile", "core.compile") ) - 'expandRight - check( + test("expandRight") - check( "application.{jar,docJar,sourcesJar}", List("application.jar", "application.docJar", "application.sourcesJar") ) - 'expandBoth - check( + test("expandBoth") - check( "{core,application}.{jar,docJar}", List( "core.jar", @@ -101,7 +101,7 @@ object ParseArgsTest extends TestSuite { "application.docJar" ) ) - 'expandNested - { + test("expandNested"){ check("{hello,world.{cow,moo}}", List("hello", "world.cow", "world.moo")) check("{a,b{c,d}}", List("a", "bc", "bd")) @@ -112,11 +112,11 @@ object ParseArgsTest extends TestSuite { check("{a{b,c},d{e,f}}", List("ab", "ac", "de", "df")) check("{a,b{c,d},e{f,g}}", List("a", "bc", "bd", "ef", "eg")) } - 'expandMixed - check( + test("expandMixed") - check( "{a,b}.{c}.{}.e", List("a.{c}.{}.e", "b.{c}.{}.e") ) - 'malformed - { + test("malformed"){ val malformed = Seq("core.{compile", "core.{compile,test]") malformed.foreach { m => @@ -124,12 +124,12 @@ object ParseArgsTest extends TestSuite { assert(error.contains("Parsing exception")) } } - 'dontExpand - { + test("dontExpand"){ check("core.compile", List("core.compile")) check("{}.compile", List("{}.compile")) check("{core}.compile", List("{core}.compile")) } - 'keepUnknownSymbols - { + test("keepUnknownSymbols"){ check("{a,b}.e<>", List("a.e<>", "b.e<>")) check("a[99]&&", List("a[99]&&")) check( @@ -139,7 +139,7 @@ object ParseArgsTest extends TestSuite { } } - 'apply - { + test("apply"){ def check(input: Seq[String], expectedSelectors: List[(Option[List[Segment]], List[Segment])], expectedArgs: Seq[String], @@ -156,10 +156,10 @@ object ParseArgsTest extends TestSuite { ) } - 'rejectEmpty { + test("rejectEmpty"){ assert(ParseArgs(Seq.empty, multiSelect = false) == Left("Selector cannot be empty")) } - 'singleSelector - check( + test("singleSelector") - check( input = Seq("core.compile"), expectedSelectors = List( None -> List(Label("core"), Label("compile")) @@ -167,7 +167,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = false ) - 'externalSelector - check( + test("externalSelector") - check( input = Seq("foo.bar/core.compile"), expectedSelectors = List( Some(List(Label("foo"), Label("bar"))) -> List(Label("core"), Label("compile")) @@ -175,7 +175,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = false ) - 'singleSelectorWithArgs - check( + test("singleSelectorWithArgs") - check( input = Seq("application.run", "hello", "world"), expectedSelectors = List( None -> List(Label("application"), Label("run")) @@ -183,7 +183,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq("hello", "world"), multiSelect = false ) - 'singleSelectorWithCross - check( + test("singleSelectorWithCross") - check( input = Seq("bridges[2.12.4,jvm].compile"), expectedSelectors = List( None -> List(Label("bridges"), Cross(Seq("2.12.4", "jvm")), Label("compile")) @@ -191,7 +191,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = false ) - 'multiSelectorsBraceExpansion - check( + test("multiSelectorsBraceExpansion") - check( input = Seq("{core,application}.compile"), expectedSelectors = List( None -> List(Label("core"), Label("compile")), @@ -200,7 +200,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = true ) - 'multiSelectorsBraceExpansionWithArgs - check( + test("multiSelectorsBraceExpansionWithArgs") - check( input = Seq("{core,application}.run", "--", "hello", "world"), expectedSelectors = List( None -> List(Label("core"), Label("run")), @@ -209,7 +209,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq("hello", "world"), multiSelect = true ) - 'multiSelectorsBraceExpansionWithCross - check( + test("multiSelectorsBraceExpansionWithCross") - check( input = Seq("bridges[2.12.4,jvm].{test,jar}"), expectedSelectors = List( None -> List(Label("bridges"), Cross(Seq("2.12.4", "jvm")), Label("test")), @@ -218,7 +218,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = true ) - 'multiSelectorsBraceExpansionInsideCross - check( + test("multiSelectorsBraceExpansionInsideCross") - check( input = Seq("bridges[{2.11.11,2.11.8,2.13.0-M3}].jar"), expectedSelectors = List( None -> List(Label("bridges"), Cross(Seq("2.11.11")), Label("jar")), @@ -228,7 +228,7 @@ object ParseArgsTest extends TestSuite { expectedArgs = Seq.empty, multiSelect = true ) - 'multiSelectorsBraceExpansionWithoutAll - { + test("multiSelectorsBraceExpansionWithoutAll"){ val res = ParseArgs(Seq("{core,application}.compile"), multiSelect = false) val expected = Right( List( @@ -239,7 +239,7 @@ object ParseArgsTest extends TestSuite { ) assert(res == expected) } - 'multiSelectorsWithoutAllAsSingle - check( + test("multiSelectorsWithoutAllAsSingle") - check( // this is how it works when we pass multiple tasks without --all flag input = Seq("core.compile", "application.compile"), expectedSelectors = List( |