Skip to content

Instantly share code, notes, and snippets.

@bryansills
Created April 12, 2013 03:30
Show Gist options
  • Save bryansills/5369114 to your computer and use it in GitHub Desktop.
Save bryansills/5369114 to your computer and use it in GitHub Desktop.
plus test
@Test
public void basicPlus() {
NFA left = new NFA(new HashSet<Character>(Arrays.asList(new Character[]{'a', 'b', 'c'})));
NFA result = NFAOperations.plus(left);
assert(result.accepts("a"));
assert(result.accepts("aa"));
assert(result.accepts("ab"));
assert(result.accepts("ba"));
assert(result.accepts("bccc"));
assertFalse(result.accepts(null));
assertFalse(result.accepts("x"));
assertFalse(result.accepts("ax"));
assertFalse(result.accepts("xc"));
assertFalse(result.accepts("cxa"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment