Skip to content

Commit

Permalink
Added test-case to reproduce issue #2958
Browse files Browse the repository at this point in the history
See #2958
  • Loading branch information
lefou committed Jan 9, 2024
1 parent eae16b2 commit c72dc11
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main/eval/test/src/mill/eval/TaskTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ trait TaskTests extends TestSuite {
superBuildTargetOverrideWithInputCount += 1
superBuildTargetOverrideWithInputCount
}

// Reproduction of issue https://github.com/com-lihaoyi/mill/issues/2958
val task1 = T.task { "task1" }
def task2 = T { task1() }
def task3 = T { task1() }
def com1() = T.command {
val t2 = task2()
val t3 = task3()
s"${t2},${t3}"
}
}

def withEnv(f: (Build, TestEvaluator) => Unit)(implicit tp: TestPath): Unit
Expand Down Expand Up @@ -241,7 +251,11 @@ trait TaskTests extends TestSuite {
check.apply(build.superBuildTargetOverrideWithInput) ==> Right((3, 0))
}
}
"duplicateTaskInResult-issue2958" - withEnv { (build,check) =>
check.apply(build.com1()) ==> Right("task1,task1", 1)
}
}

}

object SeqTaskTests extends TaskTests {
Expand Down

0 comments on commit c72dc11

Please sign in to comment.