diff --git a/pgpainless-core/src/test/java/org/pgpainless/algorithm/RegexTest.java b/pgpainless-core/src/test/java/org/pgpainless/algorithm/RegexTest.java index 0eafec9d..f1692569 100644 --- a/pgpainless-core/src/test/java/org/pgpainless/algorithm/RegexTest.java +++ b/pgpainless-core/src/test/java/org/pgpainless/algorithm/RegexTest.java @@ -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")); + } }