Exemple #1
0
 public void assertParseOperatorFails(String input, String errorMessage) {
   try {
     Parser.parseOperator(Parser.tokenize(input));
     fail();
   } catch (Parser.ParseError e) {
     assertEquals("Cannot parse: " + errorMessage, e.getMessage());
   }
 }
Exemple #2
0
 public void assertParseTermCompletelyFails(String input, String errorMessage) {
   try {
     Term r = Parser.parseTermCompletely(input);
     fail(
         String.format(
             "Successfully parsed invalid string: %s into %s and %s",
             input, r.identifier, r.options.toString()));
   } catch (Parser.ParseError e) {
     assertEquals("Cannot parse: " + errorMessage, e.getMessage());
   }
 }