@@ -13,16 +13,16 @@ class MillAlgTest extends FunSuite {
1313 test(" getDependencies, version < 0.11" ) {
1414 val repo = Repo (" lihaoyi" , " fastparse" )
1515 val buildRoot = BuildRoot (repo, " ." )
16- val repoDir = workspaceAlg.repoDir(repo ).unsafeRunSync()
17- val predef = s " $repoDir /scala-steward.sc "
18- val millCmd = Cmd .execSandboxed(repoDir , " mill" , " -i" , " -p" , predef, " show" , extractDeps)
16+ val buildRootDir = workspaceAlg.buildRootDir(buildRoot ).unsafeRunSync()
17+ val predef = s " $buildRootDir /scala-steward.sc "
18+ val millCmd = Cmd .execSandboxed(buildRootDir , " mill" , " -i" , " -p" , predef, " show" , extractDeps)
1919 val initial =
2020 MockState .empty.copy(commandOutputs = Map (millCmd -> Right (List (""" {"modules":[]}""" ))))
2121 val state = millAlg.getDependencies(buildRoot).runS(initial).unsafeRunSync()
2222 val expected = initial.copy(
2323 trace = Vector (
24- Cmd (" read" , s " $repoDir /.mill-version " ),
25- Cmd (" read" , s " $repoDir /.config/mill-version " ),
24+ Cmd (" read" , s " $buildRootDir /.mill-version " ),
25+ Cmd (" read" , s " $buildRootDir /.config/mill-version " ),
2626 Cmd (" write" , predef),
2727 millCmd,
2828 Cmd (" rm" , " -rf" , predef)
@@ -34,10 +34,9 @@ class MillAlgTest extends FunSuite {
3434 test(" getDependencies, 0.11 <= version < 0.12" ) {
3535 val repo = Repo (" lihaoyi" , " fastparse" )
3636 val buildRoot = BuildRoot (repo, " ." )
37- val repoDir = workspaceAlg.repoDir(repo).unsafeRunSync()
3837 val buildRootDir = workspaceAlg.buildRootDir(buildRoot).unsafeRunSync()
3938 val millCmd = Cmd .execSandboxed(
40- repoDir ,
39+ buildRootDir ,
4140 " mill" ,
4241 " --no-server" ,
4342 " --disable-ticker" ,
@@ -46,19 +45,17 @@ class MillAlgTest extends FunSuite {
4645 " show" ,
4746 extractDeps
4847 )
49- val initial =
50- MockState .empty
51- .copy(
52- commandOutputs = Map (millCmd -> Right (List (""" {"modules":[]}""" )))
53- )
54- .addFiles(buildRootDir / " .mill-version" -> " 0.11.0" )
55- .unsafeRunSync()
48+ val initial = MockState .empty
49+ .copy(commandOutputs = Map (millCmd -> Right (List (""" {"modules":[]}""" ))))
50+ .addFiles(buildRootDir / " .mill-version" -> " 0.11.0" , buildRootDir / " build.sc" -> " " )
51+ .unsafeRunSync()
5652 val state = millAlg.getDependencies(buildRoot).runS(initial).unsafeRunSync()
5753 val expected = initial.copy(
5854 trace = Vector (
59- Cmd (" read" , s " $repoDir /.mill-version " ),
55+ Cmd (" read" , s " $buildRootDir /.mill-version " ),
6056 millCmd,
61- Cmd (" read" , s " $repoDir/build.sc " )
57+ Cmd (" test" , " -f" , s " $buildRootDir/build.sc " ),
58+ Cmd (" read" , s " $buildRootDir/build.sc " )
6259 )
6360 )
6461 assertEquals(state, expected)
@@ -87,8 +84,8 @@ class MillAlgTest extends FunSuite {
8784 val expected = initial.copy(
8885 trace = Vector (
8986 Cmd (" read" , s " $buildRootDir/.mill-version " ),
90- Cmd (" read" , s " $buildRootDir/.config/mill-version " ),
9187 millCmd,
88+ Cmd (" test" , " -f" , s " $buildRootDir/build.sc " ),
9289 Cmd (" read" , s " $buildRootDir/build.sc " )
9390 )
9491 )
0 commit comments