diff --git a/src/test/scala/millfork/test/emu/ShouldNotCompile.scala b/src/test/scala/millfork/test/emu/ShouldNotCompile.scala index 5f140c6e..53040acd 100644 --- a/src/test/scala/millfork/test/emu/ShouldNotCompile.scala +++ b/src/test/scala/millfork/test/emu/ShouldNotCompile.scala @@ -117,7 +117,11 @@ object ShouldNotCompile extends Matchers { case f: Failure[_, _] => println(f.extra.toString) println(f.lastParser.toString) - log.error("Syntax error: " + parserF.lastLabel, Some(parserF.lastPosition)) + if (parserF.lastLabel != "") { + options.log.error(s"Syntax error: ${parserF.lastLabel} expected", Some(parserF.lastPosition)) + } else { + options.log.error("Syntax error", Some(parserF.lastPosition)) + } fail("syntax error") } } diff --git a/src/test/scala/millfork/test/emu/ShouldNotParse.scala b/src/test/scala/millfork/test/emu/ShouldNotParse.scala index 9fb3ca18..d72156e4 100644 --- a/src/test/scala/millfork/test/emu/ShouldNotParse.scala +++ b/src/test/scala/millfork/test/emu/ShouldNotParse.scala @@ -43,7 +43,11 @@ object ShouldNotParse extends Matchers { case f: Failure[_, _] => println(f.extra.toString) log.warn("Last parser: " + f.lastParser, Some(parserF.indexToPosition(f.index, f.lastParser.toString))) - log.warn("Expected syntax error: " + parserF.lastLabel, Some(parserF.lastPosition)) + if (parserF.lastLabel != "") { + log.warn(s"Expected syntax error: ${parserF.lastLabel} expected", Some(parserF.lastPosition)) + } else { + log.warn("Expected syntax error", Some(parserF.lastPosition)) + } } } }