mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-14 00:12:06 +01:00
Add test for invalid regex
This commit is contained in:
parent
766af27b02
commit
8169db4bbd
1 changed files with 7 additions and 0 deletions
|
@ -5,6 +5,7 @@
|
|||
package org.pgpainless.algorithm;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
@ -117,4 +118,10 @@ public class RegexTest {
|
|||
|
||||
RegexInterpreterFactory.setInstance(before);
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideRegexInterpreterFactories")
|
||||
public void testInvalidRegex(RegexInterpreterFactory factory) {
|
||||
assertThrows(IllegalArgumentException.class, () -> factory.instantiate("[ab"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue