From daf21a77387ebfeeed40c4c4f985b16bcd70afaa Mon Sep 17 00:00:00 2001 From: Enno Runne Date: Fri, 10 Feb 2017 20:48:09 +0100 Subject: Support expecting compiler errors from all phases --- compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala | 4 ++-- compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala index 67a09b9bf..57d66c60b 100644 --- a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala +++ b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTest.scala @@ -57,8 +57,8 @@ trait ErrorMessagesTest extends DottyTest { } } - def checkMessages(source: String): Report = { - checkCompile("frontend", source) { (_,ictx) => () } + def checkMessagesAfter(checkAfterPhase: String)(source: String): Report = { + checkCompile(checkAfterPhase, source) { (_,ictx) => () } val rep = ctx.reporter.asInstanceOf[CapturingReporter].toReport ctx = freshReporter(ctx) rep diff --git a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala index 59391cf90..f43d559d4 100644 --- a/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala +++ b/compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala @@ -12,11 +12,11 @@ class ErrorMessagesTests extends ErrorMessagesTest { // In the case where there are no errors, we can do "expectNoErrors" in the // `Report` @Test def noErrors = - checkMessages("""class Foo""") + checkMessagesAfter("frontend")("""class Foo""") .expectNoErrors @Test def typeMismatch = - checkMessages { + checkMessagesAfter("frontend") { """ |object Foo { | def bar: String = 1 -- cgit v1.2.3