@Test public void testDuplicateSymbols() { PredicateTable table = new PredicateTable(8); table.register(new UnitTestPredicates()); try { table.register(new UnitTestPredicates()); Assert.fail("Expected error on registering duplicate symbol"); } catch (RuntimeException e) { // Expected. } }
@Test public void testPredicateTable() { PredicateTable table = new PredicateTable(8); table.register(new UnitTestPredicates()); String[] expected = new String[] {"execute-error?", "invalid-args?", "required-args?", "unstable?"}; String[] symbols = table.getSymbols(); Arrays.sort(symbols); Assert.assertEquals(symbols, expected); }