From 28004ed98dae985ef38f575bb0e22c310bf239a9 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sun, 30 Jul 2017 00:46:42 -0700 Subject: [PATCH] Write tests for special cases. --- .../java/org/nwapw/abacus/tests/LexerTests.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/java/org/nwapw/abacus/tests/LexerTests.java b/src/test/java/org/nwapw/abacus/tests/LexerTests.java index 66cb7ab..c6c0a75 100644 --- a/src/test/java/org/nwapw/abacus/tests/LexerTests.java +++ b/src/test/java/org/nwapw/abacus/tests/LexerTests.java @@ -28,4 +28,17 @@ public class LexerTests { Assert.assertNull(lexer.lexAll("abcdefabcz", 0, Integer::compare)); } + @Test + public void testNoPatterns(){ + Lexer lexer = new Lexer<>(); + Assert.assertNull(lexer.lexAll("abcdefabc", 0, Integer::compare)); + } + + @Test + public void testEmptyMatches(){ + Lexer lexer = new Lexer<>(); + lexer.register("a?", 0); + Assert.assertNull(lexer.lexAll("", 0, Integer::compare)); + } + }