Skip to content

Commit fd8a02e

Browse files
committed
add failing test
1 parent 711d10d commit fd8a02e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

compiler/test/dotty/tools/dotc/plugins/PluginsTest.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,29 @@ class PluginsTest {
150150
assert(updatedPlan2(4)(0) eq M2)
151151
}
152152

153+
@Test
154+
def orderingTwoPlugins4 = {
155+
object M1 extends TestPhase {
156+
override val runsAfter = Set(classOf[P3d])
157+
override val runsBefore = Set(classOfPhase(M2), classOf[P7])
158+
}
159+
object M2 extends TestPhase {
160+
override val runsAfter = Set(classOf[P3d])
161+
override val runsBefore = Set(classOf[P5], classOf[P8])
162+
}
163+
164+
// M1 inserted to plan first
165+
val updatedPlan1 = Plugins.schedule(basicPlan, M1 :: M2 :: Nil)
166+
assert(updatedPlan1(6)(0) eq M1)
167+
assert(updatedPlan1(7)(0) eq M2)
168+
169+
// M2 inserted to plan first
170+
val updatedPlan2 = Plugins.schedule(basicPlan, M2 :: M1 :: Nil)
171+
assert(updatedPlan2(4)(0) eq M1)
172+
assert(updatedPlan2(5)(0) eq M2)
173+
}
174+
175+
153176
@Test
154177
def deterministic = {
155178
object M1 extends TestPhase {

0 commit comments

Comments
 (0)