@Test public void testSequenceMatching() throws Exception { String msg = String.format("doesn't match length-%s sequences", password.length()); assertEquals(msg, new SequenceMatcher().execute(password).size(), 0); }
@Test public void testSequenceMatching() throws Exception { List<Match> actualMatches = new SequenceMatcher().execute("abcbabc"); ExpectedMatch[] expectedMatches = new ExpectedMatch[]{ new ExpectedMatch("abc", 0, 2).ascending(true), new ExpectedMatch("cba", 2, 4).ascending(false), new ExpectedMatch("abc", 4, 6).ascending(true) }; assertMatches("matches overlapping patterns", Pattern.Sequence, expectedMatches, actualMatches); }