@Test public void testGetErrorStringHasUrl() { String input = new String(Character.toChars(0x26bd)); ParsingResult<AstNode> result = new ReportingParseRunner<AstNode>( Parser.instance().getInputRule(Grammar.IP_SPACE_SPECIFIER)) .run(input); String errorString = ParserUtils.getErrorString( input, Grammar.IP_SPACE_SPECIFIER, (InvalidInputError) result.parseErrors.get(0), Parser.ANCHORS); assertThat(errorString, containsString(Grammar.IP_SPACE_SPECIFIER.getFullUrl())); }
static String getErrorString( String input, Grammar grammar, InvalidInputError error, Map<String, Anchor.Type> anchorTypes) { return String.format( "%s. See %s for valid grammar.", getErrorString( input, grammar.getFriendlyName(), error.getStartIndex(), getPotentialMatches(error, anchorTypes, true)), grammar.getFullUrl()); }
ParserUtils { static String getErrorString( String input, Grammar grammar, InvalidInputError error, Map<String, Anchor.Type> anchorTypes) { return String.format( "%s. See %s for valid grammar.", getErrorString( input, grammar.getFriendlyName(), error.getStartIndex(), getPotentialMatches(error, anchorTypes, true)), grammar.getFullUrl()); } }
ParserUtils { static String getErrorString( String input, Grammar grammar, InvalidInputError error, Map<String, Anchor.Type> anchorTypes) { return String.format( "%s. See %s for valid grammar.", getErrorString( input, grammar.getFriendlyName(), error.getStartIndex(), getPotentialMatches(error, anchorTypes, true)), grammar.getFullUrl()); }  }
ParserUtils { static String getErrorString( String input, Grammar grammar, InvalidInputError error, Map<String, Anchor.Type> anchorTypes) { return String.format( "%s. See %s for valid grammar.", getErrorString( input, grammar.getFriendlyName(), error.getStartIndex(), getPotentialMatches(error, anchorTypes, true)), grammar.getFullUrl()); }   }
ParserUtils { static String getErrorString( String input, Grammar grammar, InvalidInputError error, Map<String, Anchor.Type> anchorTypes) { return String.format( "%s. See %s for valid grammar.", getErrorString( input, grammar.getFriendlyName(), error.getStartIndex(), getPotentialMatches(error, anchorTypes, true)), grammar.getFullUrl()); }    }