google-code-export / hamcrest-text-patterns

Automatically exported from code.google.com/p/hamcrest-text-patterns
Other
0 stars 0 forks source link

Sequence does not use a non-capturing group #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Sequence should use a non-capturing group otherwise it cannot safely be used 
within other components.

For instance, this test will fail:

PatternComponent component = exactly(2, sequence("a", "b"));
PatternMatcher matches = new PatternMatcher(component);
assertThat("abab", matches);

This matches "abb" instead.

Original issue reported on code.google.com by oliver.p...@gmail.com on 3 Jun 2013 at 4:25