protected void checkGrammarSemanticsWarning( ErrorQueue equeue, GrammarSemanticsMessage expectedMessage) throws Exception { ANTLRMessage foundMsg = null; for (int i = 0; i < equeue.warnings.size(); i++) { ANTLRMessage m = equeue.warnings.get(i); if (m.errorType == expectedMessage.errorType) { foundMsg = m; } } assertNotNull("no error; " + expectedMessage.errorType + " expected", foundMsg); assertTrue( "error is not a GrammarSemanticsMessage", foundMsg instanceof GrammarSemanticsMessage); assertEquals(Arrays.toString(expectedMessage.args), Arrays.toString(foundMsg.args)); if (equeue.size() != 1) { System.err.println(equeue); } }
@Test public void testMutualExclusion() { List<String[]> testList = q.getMutualExclusion(); assertEquals("[testArg, testArg2]", Arrays.toString(testList.get(0))); }