diff options
Diffstat (limited to 'contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala')
-rw-r--r-- | contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala b/contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala index e2147bac..05070985 100644 --- a/contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala +++ b/contrib/buildinfo/test/src/mill/contrib/BuildInfoTests.scala @@ -1,6 +1,5 @@ package mill.contrib -import ammonite.ops._ import java.util.jar.JarFile import mill._ import mill.define.Target @@ -43,16 +42,16 @@ object BuildInfoTests extends TestSuite { } } - val resourcePath = pwd / 'contrib / 'buildinfo / 'test / 'resources / "buildinfo" + val resourcePath = os.pwd / 'contrib / 'buildinfo / 'test / 'resources / "buildinfo" - def workspaceTest[T](m: TestUtil.BaseModule, resourcePath: Path = resourcePath) + def workspaceTest[T](m: TestUtil.BaseModule, resourcePath: os.Path = resourcePath) (t: TestEvaluator => T) (implicit tp: TestPath): T = { val eval = new TestEvaluator(m) - rm(m.millSourcePath) - rm(eval.outPath) - mkdir(m.millSourcePath / up) - cp(resourcePath, m.millSourcePath) + os.remove.all(m.millSourcePath) + os.remove.all(eval.outPath) + os.makeDir.all(m.millSourcePath / os.up) + os.copy(resourcePath, m.millSourcePath) t(eval) } @@ -68,8 +67,8 @@ object BuildInfoTests extends TestSuite { val Right((result, evalCount)) = eval.apply(BuildInfo.buildInfo) assert( result.head.path == eval.outPath / 'buildInfo / 'dest / "BuildInfo.scala" && - exists(result.head.path) && - read! result.head.path == expected + os.exists(result.head.path) && + os.read(result.head.path) == expected ) } @@ -77,7 +76,7 @@ object BuildInfoTests extends TestSuite { val Right((result, evalCount)) = eval.apply(EmptyBuildInfo.buildInfo) assert( result.isEmpty && - !exists(eval.outPath / 'buildInfo / 'dest / "BuildInfo.scala") + !os.exists(eval.outPath / 'buildInfo / 'dest / "BuildInfo.scala") ) } @@ -90,8 +89,8 @@ object BuildInfoTests extends TestSuite { val Right((result, evalCount)) = eval.apply(BuildInfoSettings.buildInfo) assert( result.head.path == eval.outPath / 'buildInfo / 'dest / "BuildInfo.scala" && - exists(result.head.path) && - read! result.head.path == expected + os.exists(result.head.path) && + os.read(result.head.path) == expected ) } @@ -104,8 +103,8 @@ object BuildInfoTests extends TestSuite { val runResult = eval.outPath / "hello-mill" val Right((result, evalCount)) = eval.apply(BuildInfo.run(runResult.toString)) assert( - exists(runResult), - read(runResult) == scalaVersionString) + os.exists(runResult), + os.read(runResult) == scalaVersionString) } } } |