@Test public void matches_zero_occurrences() { final Ndfa ndfa = ndfaFactory.create(); assertTrue(ndfa.isAccepting()); assertTrue(ndfa.isAlive()); ndfa.onChar('p'); assertTrue(!ndfa.isAccepting()); assertTrue(!ndfa.isAlive()); }
@Test public void matches_single_character() { final Ndfa ndfa = ndfaFactory.create(); assertTrue(!ndfa.isAccepting()); assertTrue(ndfa.isAlive()); ndfa.onChar('c'); assertTrue(ndfa.isAccepting()); assertTrue(ndfa.isAlive()); ndfa.onChar('d'); assertTrue(!ndfa.isAccepting()); assertTrue(!ndfa.isAlive()); }