import java.util.regex.Pattern;

public class BuggyRegexTest {


    public static void main(String[] args) {
        Object[][] data = new Object[][]{
                {"test\ud834\uddc0", "test\ud834\uddbc\ud834\udd6f", true}, //From broken Regex Test
                {"test\ud834\uddbc\ud834\udd6f", "test\ud834\uddc0", true}, //From broken Regex Test
                {"test\u2126", "test\u03A9", true}, //Ohm to Omega
                {"test\u03A9", "test\u2126", true} //Omega to Ohm
        };

        for(Object[] d : data) {
            String pn = (String) d[0];
            String tt = (String) d[1];
            boolean expected = (boolean) d[2];
            var Pat = Pattern.compile(pn, Pattern.CANON_EQ);
            var Mat = Pat.matcher(tt);
            boolean ret = Mat.matches();
            if (ret != expected) {
                System.out.println("pn: " + pn + "\ntt: " + tt + "\nexpected: " + expected + "\nret: " + ret);
            } else {
                System.out.println("Correctly equated: " + pn + " to " + tt);
            }
        }
    }
}
