1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-14 16:32:06 +01:00

Add test for invalid regex

This commit is contained in:
Paul Schaub 2022-11-30 15:58:38 +01:00
parent 766af27b02
commit 8169db4bbd

View file

@ -5,6 +5,7 @@
package org.pgpainless.algorithm; package org.pgpainless.algorithm;
import static org.junit.jupiter.api.Assertions.assertFalse; 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 static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -117,4 +118,10 @@ public class RegexTest {
RegexInterpreterFactory.setInstance(before); RegexInterpreterFactory.setInstance(before);
} }
@ParameterizedTest
@MethodSource("provideRegexInterpreterFactories")
public void testInvalidRegex(RegexInterpreterFactory factory) {
assertThrows(IllegalArgumentException.class, () -> factory.instantiate("[ab"));
}
} }