1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-13 07:04:51 +02: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;
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"));
}
}