diff --git a/eo-parser/src/test/java/org/eolang/parser/EoIndentLexerTest.java b/eo-parser/src/test/java/org/eolang/parser/EoIndentLexerTest.java index 5348f23d47..a1cb02cc99 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoIndentLexerTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoIndentLexerTest.java @@ -35,6 +35,11 @@ * @since 1.0 */ final class EoIndentLexerTest { + /** + * Empty message for JUnit Assertions. + */ + private static final String EMPTY_MSG = "EMPTY MESSAGE"; + @Test void emitsTab() throws IOException { final EoIndentLexer lexer = new EoIndentLexer( @@ -42,6 +47,7 @@ void emitsTab() throws IOException { ); lexer.nextToken(); MatcherAssert.assertThat( + EoIndentLexerTest.EMPTY_MSG, lexer.nextToken().getType(), Matchers.is( EoParser.TAB @@ -55,6 +61,7 @@ void ensuresGrammarFile() throws IOException { new TextOf("") ); MatcherAssert.assertThat( + EoIndentLexerTest.EMPTY_MSG, lexer.getGrammarFileName(), Matchers.is( "Eo.g4" @@ -69,6 +76,7 @@ void emitsTabWhenEmptyLine() throws IOException { ); lexer.nextToken(); MatcherAssert.assertThat( + EoIndentLexerTest.EMPTY_MSG, lexer.nextToken().getType(), Matchers.is( EoParser.TAB @@ -85,6 +93,7 @@ void emitsUntab() throws IOException { lexer.nextToken(); lexer.nextToken(); MatcherAssert.assertThat( + EoIndentLexerTest.EMPTY_MSG, lexer.nextToken().getType(), Matchers.is( EoParser.UNTAB @@ -98,6 +107,7 @@ void readsEmptyString() throws IOException { new TextOf("") ); MatcherAssert.assertThat( + EoIndentLexerTest.EMPTY_MSG, lexer.nextToken().getType(), Matchers.is( EoParser.EOF diff --git a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java index 3927ce3a48..d735b73ac5 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java @@ -50,9 +50,15 @@ */ @SuppressWarnings("PMD.TooManyMethods") final class EoSyntaxTest { + /** + * Empty message for JUnit Assertions. + */ + private static final String EMPTY_MSG = "EMPTY MESSAGE"; + @Test void parsesSimpleCode() throws Exception { MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, XhtmlMatchers.xhtml( new String( new EoSyntax( @@ -86,6 +92,7 @@ void containsCommentCheckErrors( final String message ) throws IOException { MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, XhtmlMatchers.xhtml( new String( new EoSyntax( @@ -118,6 +125,7 @@ void printsProperListingEvenWhenSyntaxIsBroken() throws Exception { "[] > x-н, 1\n" ); MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, XhtmlMatchers.xhtml( new String( new EoSyntax( @@ -149,6 +157,7 @@ void copiesListingCorrectly() throws Exception { ) ); MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, xml.xpath("/program/listing/text()"), Matchers.contains(src) ); @@ -178,6 +187,7 @@ void parsesSuccessfully(final String code) { @Test void parsesArrow() throws IOException { MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, new EoSyntax( "test-it-3", new InputOf("1 > x") @@ -201,6 +211,7 @@ void prasesNested() throws IOException { " v\n" ); MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, new EoSyntax( "test-it-4", new InputOf(src) @@ -215,6 +226,7 @@ void prasesNested() throws IOException { @Test void parsesDefinition() throws IOException { MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, new EoSyntax( "test-it-5", new InputOf( @@ -236,6 +248,7 @@ void parsesDefinition() throws IOException { @Test void parsesMethodCalls() throws IOException { MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, new EoSyntax( "test-it-1", new InputOf("add.\n 0\n TRUE") @@ -265,6 +278,7 @@ void storesAsBytes(final String code) throws IOException { ) ); MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, xml, XhtmlMatchers.hasXPaths( "/program/objects[count(o)=1]", @@ -284,6 +298,7 @@ void checksTypoPacks(final String yml) throws IOException, NumberFormatException new InputOf(String.format("%s\n", map.get("eo"))) ).parsed(); MatcherAssert.assertThat( + EoSyntaxTest.EMPTY_MSG, XhtmlMatchers.xhtml(xml.toString()), XhtmlMatchers.hasXPaths("/program/errors/error/@line") ); diff --git a/eo-parser/src/test/java/org/eolang/parser/ObjectsTest.java b/eo-parser/src/test/java/org/eolang/parser/ObjectsTest.java index 8a122ab58c..e0bbfa9663 100644 --- a/eo-parser/src/test/java/org/eolang/parser/ObjectsTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/ObjectsTest.java @@ -43,6 +43,7 @@ void parsesOneObject() { objs.data("xxx"); objs.leave(); MatcherAssert.assertThat( + "EMPTY MESSAGE", new XMLDocument(new Xembler(objs).domQuietly()), XhtmlMatchers.hasXPaths( "/o", @@ -64,6 +65,7 @@ void parsesNestedObjects() { objs.leave(); objs.leave(); MatcherAssert.assertThat( + "EMPTY MESSAGE", new XMLDocument(new Xembler(objs).domQuietly()), XhtmlMatchers.hasXPaths( "/o", @@ -82,6 +84,7 @@ void parsesObjectsWithEnteringPrevious() { objs.enter(); objs.prop("z", "a"); MatcherAssert.assertThat( + "EMPTY MESSAGE", new XMLDocument(new Xembler(objs).domQuietly()), XhtmlMatchers.hasXPaths( "/o/o", diff --git a/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java b/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java index 74abeecf9f..729af488c5 100644 --- a/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java @@ -35,10 +35,15 @@ * @since 0.29.0 */ final class StUnhexTest { - + /** + * Empty message for JUnit Assertions. + */ + private static final String EMPTY_MSG = "EMPTY MESSAGE"; + @Test void convertsIntFromHexToEo() { MatcherAssert.assertThat( + StUnhexTest.EMPTY_MSG, new Xsline(new StUnhex()).pass( new XMLDocument( "