Write tests for special cases.

This commit is contained in:
Danila Fedorin 2017-07-30 00:46:42 -07:00
parent 317cc552e6
commit 28004ed98d
1 changed files with 13 additions and 0 deletions

View File

@ -28,4 +28,17 @@ public class LexerTests {
Assert.assertNull(lexer.lexAll("abcdefabcz", 0, Integer::compare));
}
@Test
public void testNoPatterns(){
Lexer<Integer> lexer = new Lexer<>();
Assert.assertNull(lexer.lexAll("abcdefabc", 0, Integer::compare));
}
@Test
public void testEmptyMatches(){
Lexer<Integer> lexer = new Lexer<>();
lexer.register("a?", 0);
Assert.assertNull(lexer.lexAll("", 0, Integer::compare));
}
}