blob: dab60a01c543fd902a736032cb611065d8acf65c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
package mill.discover
import mill.define.Segment.Label
import mill.define.Segments
import mill.util.{TestGraphs}
import mill.util.Strict.Agg
import utest._
object ConsistencyTests extends TestSuite{
val tests = Tests{
val graphs = new TestGraphs()
import graphs._
'failConsistencyChecks - {
// Make sure these fail because `def`s without `Cacher` will re-evaluate
// each time, returning different sets of targets.
//
// Maybe later we can convert them into compile errors somehow
val expected = Agg(
Segments(Label("down")),
Segments(Label("right")),
Segments(Label("left")),
Segments(Label("up"))
)
'diamond - {
val inconsistent = Discovered.consistencyCheck(
Discovered.mapping(diamond)
)
assert(inconsistent == Agg())
}
'anonDiamond - {
val inconsistent = Discovered.consistencyCheck(
Discovered.mapping(anonDiamond)
)
assert(inconsistent == Agg())
}
'borkedCachedDiamond2 - {
val inconsistent = Discovered.consistencyCheck(
Discovered.mapping(borkedCachedDiamond2)
)
assert(inconsistent.toSet == expected.toSet)
}
'borkedCachedDiamond3 - {
val inconsistent = Discovered.consistencyCheck(
Discovered.mapping(borkedCachedDiamond3)
)
assert(inconsistent.toSet == expected.toSet)
}
}
}
}
|