1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-06-13 07:04:51 +02:00
pgpainless/hsregex/src/test/java/org/pgpainless/algorithm/HSRegexInterpreterFactoryTest.java

25 lines
733 B
Java

// SPDX-FileCopyrightText: 2022 Paul Schaub <vanitasvitae@fsfe.org>
//
// SPDX-License-Identifier: Apache-2.0
package org.pgpainless.algorithm;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class HSRegexInterpreterFactoryTest {
@Test
public void dummyRegexTest() {
HSRegexInterpreterFactory factory = new HSRegexInterpreterFactory();
RegexInterpreterFactory.setInstance(factory);
Regex regex = RegexInterpreterFactory.create("Alice|Bob");
assertTrue(regex.matches("Alice"));
assertTrue(regex.matches("Bob"));
assertFalse(regex.matches("Charlie"));
}
}