From 63e9971f235a2d5c43867bbc7386e7bb925f27e7 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 19 Feb 2024 00:13:29 +0100 Subject: [PATCH] [IDNA] Clean up `GenerateIdnaTest.testCases` - Removes unused data and converts `testCases` to a simple String array - Removes duplicate entries --- .../org/unicode/idna/GenerateIdnaTest.java | 640 +++++------------- 1 file changed, 167 insertions(+), 473 deletions(-) diff --git a/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java b/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java index c17657274..3a6717de0 100644 --- a/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java +++ b/unicodetools/src/main/java/org/unicode/idna/GenerateIdnaTest.java @@ -162,8 +162,7 @@ int generateTests(int lines) throws IOException { count += generateLine(s, out, out2); } - for (final Object[] testCaseLine : testCases) { - final String source = testCaseLine[0].toString(); + for (final String source : testCases) { count += generateLine(source, out, out2); } @@ -655,166 +654,61 @@ public static UnicodeSet getIdna2008Valid() { {"aب\u0308\u200D\u0308بb", "C2"}, }; - public static final Object[][] testCases = { + public static final String[] testCases = { // special case - {"。", "B", "。", 0}, + "。", // special case - {"\uAB60", "B", "\uAB60", 0}, - { - "1234567890\u00E41234567890123456789012345678901234567890123456", - "B", - "1234567890\u00E41234567890123456789012345678901234567890123456", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, + "\uAB60", + "1234567890\u00E41234567890123456789012345678901234567890123456", // all ASCII - {"www.eXample.cOm", "B", "www.example.com", 0}, + "www.eXample.cOm", // u-umlaut - {"B\u00FCcher.de", "B", "b\u00FCcher.de", 0}, + "B\u00FCcher.de", // O-umlaut - {"\u00D6BB", "B", "\u00F6bb", 0}, + "\u00D6BB", // sharp s - {"fa\u00DF.de", "N", "fa\u00DF.de", 0}, - {"FA\u1E9E.de", "N", "fa\u00DF.de", 0}, - {"fa\u00DF.de", "T", "fass.de", 0}, + "fa\u00DF.de", + "FA\u1E9E.de", // sharp s in Punycode - {"XN--fA-hia.dE", "B", "fa\u00DF.de", 0}, + "XN--fA-hia.dE", // Greek with final sigma - {"\u03B2\u03CC\u03BB\u03BF\u03C2.com", "N", "\u03B2\u03CC\u03BB\u03BF\u03C2.com", 0}, - // Greek with final - // sigma - {"\u03B2\u03CC\u03BB\u03BF\u03C2.com", "T", "\u03B2\u03CC\u03BB\u03BF\u03C3.com", 0}, - { - "xn--nxasmm1c", - "B", // Greek with final sigma in Punycode - "\u03B2\u03CC\u03BB\u03BF\u03C2", - 0 - }, - { - "www.\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", - "N", // "Sri" in "Sri - // Lanka" has a ZWJ - "www.\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", - 0 - }, - { - "www.\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", - "T", // "Sri" in "Sri - // Lanka" has a ZWJ - "www.\u0DC1\u0DCA\u0DBB\u0DD3.com", - 0 - }, - { - "www.xn--10cl1a0b660p.com", - "B", // "Sri" in Punycode - "www.\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", - 0 - }, - { - "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC", - "N", // ZWNJ - "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC", - 0 - }, - { - "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC", - "T", // ZWNJ - "\u0646\u0627\u0645\u0647\u0627\u06CC", - 0 - }, - { - "xn--mgba3gch31f060k.com", - "B", // ZWNJ in Punycode - "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC.com", - 0 - }, - {"a.b\uFF0Ec\u3002d\uFF61", "B", "a.b.c.d.", 0}, - { - "U\u0308.xn--tda", - "B", // U+umlaut.u-umlaut - "\u00FC.\u00FC", - 0 - }, - { - "xn--u-ccb", - "B", // u+umlaut in Punycode - "xn--u-ccb\uFFFD", - Uts46.UIDNA_ERROR_INVALID_ACE_LABEL - }, - { - "a\u2488com", - "B", // contains 1-dot - "a\uFFFDcom", - Uts46.UIDNA_ERROR_DISALLOWED - }, - { - "xn--a-ecp.ru", - "B", // contains 1-dot in Punycode - "xn--a-ecp\uFFFD.ru", - Uts46.UIDNA_ERROR_INVALID_ACE_LABEL - }, - { - "xn--0.pt", - "B", // invalid Punycode - "xn--0\uFFFD.pt", - Uts46.UIDNA_ERROR_PUNYCODE - }, - { - "xn--a.pt", - "B", // U+0080 - "xn--a\uFFFD.pt", - Uts46.UIDNA_ERROR_INVALID_ACE_LABEL - }, - { - "xn--a-\u00C4.pt", - "B", // invalid Punycode - "xn--a-\u00E4.pt", - Uts46.UIDNA_ERROR_PUNYCODE - }, - { - "\u65E5\u672C\u8A9E\u3002\uFF2A\uFF30", - "B", // Japanese with - // fullwidth ".jp" - "\u65E5\u672C\u8A9E.jp", - 0 - }, - {"\u2615", "B", "\u2615", 0}, // Unicode 4.0 HOT BEVERAGE + "\u03B2\u03CC\u03BB\u03BF\u03C2.com", + // Greek with final sigma in Punycode + "xn--nxasmm1c", + // "Sri" in "Sri Lanka" has a ZWJ + "www.\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", + // "Sri" in Punycode + "www.xn--10cl1a0b660p.com", + // ZWNJ + "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC", + // ZWNJ in Punycode + "xn--mgba3gch31f060k.com", + "a.b\uFF0Ec\u3002d\uFF61", + // U+umlaut.u-umlaut + "U\u0308.xn--tda", + // u+umlaut in Punycode + "xn--u-ccb", + // contains 1-dot + "a\u2488com", + // contains 1-dot in Punycode + "xn--a-ecp.ru", + // invalid Punycode + "xn--0.pt", + // U+0080 + "xn--a.pt", + // invalid Punycode + "xn--a-\u00C4.pt", + // Japanese with fullwidth ".jp" + "\u65E5\u672C\u8A9E\u3002\uFF2A\uFF30", + "\u2615", // many deviation characters, test the special mapping code - { - "1.a\u00DF\u200C\u200Db\u200C\u200Dc\u00DF\u00DF\u00DF\u00DFd" - + "\u03C2\u03C3\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFe" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFx" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFy" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u0302\u00DFz", - "N", - "1.a\u00DF\u200C\u200Db\u200C\u200Dc\u00DF\u00DF\u00DF\u00DFd" - + "\u03C2\u03C3\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFe" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFx" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFy" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u0302\u00DFz", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG | Uts46.UIDNA_ERROR_CONTEXTJ - }, - { - "1.a\u00DF\u200C\u200Db\u200C\u200Dc\u00DF\u00DF\u00DF\u00DFd" - + "\u03C2\u03C3\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFe" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFx" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFy" - + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u0302\u00DFz", - "T", - "1.assbcssssssssd" - + "\u03C3\u03C3sssssssssssssssse" - + "ssssssssssssssssssssx" - + "ssssssssssssssssssssy" - + "sssssssssssssss\u015Dssz", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, + "1.a\u00DF\u200C\u200Db\u200C\u200Dc\u00DF\u00DF\u00DF\u00DFd" + + "\u03C2\u03C3\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFe" + + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFx" + + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DFy" + + "\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u00DF\u0302\u00DFz", // "xn--bss" with deviation characters - { - "\u200Cx\u200Dn\u200C-\u200D-b\u00DF", - "N", - "\u200Cx\u200Dn\u200C-\u200D-b\u00DF", - Uts46.UIDNA_ERROR_CONTEXTJ - }, - {"\u200Cx\u200Dn\u200C-\u200D-b\u00DF", "T", "\u5919", 0}, + "\u200Cx\u200Dn\u200C-\u200D-b\u00DF", // "xn--bssffl" written as: // 02E3 MODIFIER LETTER SMALL X // 034F COMBINING GRAPHEME JOINER (ignored) @@ -831,346 +725,146 @@ public static UnicodeSet getIdna2008Valid() { // 1D530 MATHEMATICAL FRAKTUR SMALL S // E01EF VARIATION SELECTOR-256 (ignored) // FB04 LATIN SMALL LIGATURE FFL - { - "\u02E3\u034F\u2115\u200B\uFE63\u00AD\uFF0D\u180C" - + "\u212C\uFE00\u017F\u2064" - // + "\\U0001D530" - + UTF16.valueOf(0x1D530) - // + "\\U000E01EF" - + UTF16.valueOf(0xE01EF) - + "\uFB04", - "B", - "\u5921\u591E\u591C\u5919", - 0 - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - 0 - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901.", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901.", - 0 - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "12345678901234567890123456789012345678901234567890123456789012", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890123." - + "12345678901234567890123456789012345678901234567890123456789012", - Uts46.UIDNA_ERROR_DOMAIN_NAME_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890.", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890.", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901234." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG | Uts46.UIDNA_ERROR_DOMAIN_NAME_TOO_LONG - }, + "\u02E3\u034F\u2115\u200B\uFE63\u00AD\uFF0D\u180C" + + "\u212C\uFE00\u017F\u2064" + + UTF16.valueOf(0x1D530) + + UTF16.valueOf(0xE01EF) + + "\uFB04", + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901", + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901.", + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890123." + + "12345678901234567890123456789012345678901234567890123456789012", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901234." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901234." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890.", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901234." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901", // label length 63: // xn--1234567890123456789012345678901234567890123456789012345-9te - { - "\u00E41234567890123456789012345678901234567890123456789012345", - "B", - "\u00E41234567890123456789012345678901234567890123456789012345", - 0 - }, - { - "1234567890\u00E41234567890123456789012345678901234567890123456", - "B", - "1234567890\u00E41234567890123456789012345678901234567890123456", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - 0 - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901.", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901.", - 0 - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "12345678901234567890123456789012345678901234567890123456789012", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E4123456789012345678901234567890123456789012345." - + "123456789012345678901234567890123456789012345678901234567890123." - + "12345678901234567890123456789012345678901234567890123456789012", - Uts46.UIDNA_ERROR_DOMAIN_NAME_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890.", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "123456789012345678901234567890123456789012345678901234567890.", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG - }, - { - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - "B", - "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890\u00E41234567890123456789012345678901234567890123456." - + "123456789012345678901234567890123456789012345678901234567890123." - + "1234567890123456789012345678901234567890123456789012345678901", - Uts46.UIDNA_ERROR_LABEL_TOO_LONG | Uts46.UIDNA_ERROR_DOMAIN_NAME_TOO_LONG - }, + "\u00E41234567890123456789012345678901234567890123456789012345", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E4123456789012345678901234567890123456789012345." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E4123456789012345678901234567890123456789012345." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901.", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E4123456789012345678901234567890123456789012345." + + "123456789012345678901234567890123456789012345678901234567890123." + + "12345678901234567890123456789012345678901234567890123456789012", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E41234567890123456789012345678901234567890123456." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E41234567890123456789012345678901234567890123456." + + "123456789012345678901234567890123456789012345678901234567890123." + + "123456789012345678901234567890123456789012345678901234567890.", + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890\u00E41234567890123456789012345678901234567890123456." + + "123456789012345678901234567890123456789012345678901234567890123." + + "1234567890123456789012345678901234567890123456789012345678901", // hyphen errors and empty-label errors // "xn---q----jra"=="-q--a-umlaut-" - { - "a.b..-q--a-.e", - "B", - "a.b..-q--a-.e", - Uts46.UIDNA_ERROR_EMPTY_LABEL - | Uts46.UIDNA_ERROR_LEADING_HYPHEN - | Uts46.UIDNA_ERROR_TRAILING_HYPHEN - | Uts46.UIDNA_ERROR_HYPHEN_3_4 - }, - { - "a.b..-q--\u00E4-.e", - "B", - "a.b..-q--\u00E4-.e", - Uts46.UIDNA_ERROR_EMPTY_LABEL - | Uts46.UIDNA_ERROR_LEADING_HYPHEN - | Uts46.UIDNA_ERROR_TRAILING_HYPHEN - | Uts46.UIDNA_ERROR_HYPHEN_3_4 - }, - { - "a.b..xn---q----jra.e", - "B", - "a.b..-q--\u00E4-.e", - Uts46.UIDNA_ERROR_EMPTY_LABEL - | Uts46.UIDNA_ERROR_LEADING_HYPHEN - | Uts46.UIDNA_ERROR_TRAILING_HYPHEN - | Uts46.UIDNA_ERROR_HYPHEN_3_4 - }, - {"a..c", "B", "a..c", Uts46.UIDNA_ERROR_EMPTY_LABEL}, - {"a.-b.", "B", "a.-b.", Uts46.UIDNA_ERROR_LEADING_HYPHEN}, - {"a.b-.c", "B", "a.b-.c", Uts46.UIDNA_ERROR_TRAILING_HYPHEN}, - { - "a.-.c", - "B", - "a.-.c", - Uts46.UIDNA_ERROR_LEADING_HYPHEN | Uts46.UIDNA_ERROR_TRAILING_HYPHEN - }, - {"a.bc--de.f", "B", "a.bc--de.f", Uts46.UIDNA_ERROR_HYPHEN_3_4}, - {"\u00E4.\u00AD.c", "B", "\u00E4..c", Uts46.UIDNA_ERROR_EMPTY_LABEL}, - {"\u00E4.-b.", "B", "\u00E4.-b.", Uts46.UIDNA_ERROR_LEADING_HYPHEN}, - {"\u00E4.b-.c", "B", "\u00E4.b-.c", Uts46.UIDNA_ERROR_TRAILING_HYPHEN}, - { - "\u00E4.-.c", - "B", - "\u00E4.-.c", - Uts46.UIDNA_ERROR_LEADING_HYPHEN | Uts46.UIDNA_ERROR_TRAILING_HYPHEN - }, - {"\u00E4.bc--de.f", "B", "\u00E4.bc--de.f", Uts46.UIDNA_ERROR_HYPHEN_3_4}, - {"a.b.\u0308c.d", "B", "a.b.\uFFFDc.d", Uts46.UIDNA_ERROR_LEADING_COMBINING_MARK}, - {"a.b.xn--c-bcb.d", "B", "a.b.xn--c-bcb\uFFFD.d", Uts46.UIDNA_ERROR_LEADING_COMBINING_MARK}, + "a.b..-q--a-.e", + "a.b..-q--\u00E4-.e", + "a.b..xn---q----jra.e", + "a..c", + "a.-b.", + "a.b-.c", + "a.-.c", + "a.bc--de.f", + "\u00E4.\u00AD.c", + "\u00E4.-b.", + "\u00E4.b-.c", + "\u00E4.-.c", + "\u00E4.bc--de.f", + "a.b.\u0308c.d", + "a.b.xn--c-bcb.d", // BiDi - {"A0", "B", "a0", 0}, - {"0A", "B", "0a", 0}, // all-LTR is ok to start with a digit (EN) - { - "0A.\u05D0", - "B", // ASCII label does not start with L/R/AL - "0a.\u05D0", - Uts46.UIDNA_ERROR_BIDI - }, - { - "c.xn--0-eha.xn--4db", - "B", // 2nd label does not start with - // L/R/AL - "c.0\u00FC.\u05D0", - Uts46.UIDNA_ERROR_BIDI - }, - { - "b-.\u05D0", - "B", // label does not end with L/EN - "b-.\u05D0", - Uts46.UIDNA_ERROR_TRAILING_HYPHEN | Uts46.UIDNA_ERROR_BIDI - }, - { - "d.xn----dha.xn--4db", - "B", // 2nd label does not end with L/EN - "d.\u00FC-.\u05D0", - Uts46.UIDNA_ERROR_TRAILING_HYPHEN | Uts46.UIDNA_ERROR_BIDI - }, - {"a\u05D0", "B", "a\u05D0", Uts46.UIDNA_ERROR_BIDI}, // first dir + "A0", + // all-LTR is ok to start with a digit (EN) + "0A", + // ASCII label does not start with L/R/AL + "0A.\u05D0", + // 2nd label does not start with L/R/AL + "c.xn--0-eha.xn--4db", + // label does not end with L/EN + "b-.\u05D0", + // 2nd label does not end with L/EN + "d.xn----dha.xn--4db", + "a\u05D0", // != last // dir - {"\u05D0\u05C7", "B", "\u05D0\u05C7", 0}, - {"\u05D09\u05C7", "B", "\u05D09\u05C7", 0}, - {"\u05D0a\u05C7", "B", "\u05D0a\u05C7", Uts46.UIDNA_ERROR_BIDI}, // first + "\u05D0\u05C7", + "\u05D09\u05C7", + "\u05D0a\u05C7", // dir // != // last // dir - {"\u05D0\u05EA", "B", "\u05D0\u05EA", 0}, - {"\u05D0\u05F3\u05EA", "B", "\u05D0\u05F3\u05EA", 0}, - {"a\u05D0Tz", "B", "a\u05D0tz", Uts46.UIDNA_ERROR_BIDI}, // mixed + "\u05D0\u05EA", + "\u05D0\u05F3\u05EA", + "a\u05D0Tz", // dir - {"\u05D0T\u05EA", "B", "\u05D0t\u05EA", Uts46.UIDNA_ERROR_BIDI}, // mixed + "\u05D0T\u05EA", // dir - {"\u05D07\u05EA", "B", "\u05D07\u05EA", 0}, - {"\u05D0\u0667\u05EA", "B", "\u05D0\u0667\u05EA", 0}, // Arabic 7 + "\u05D07\u05EA", + "\u05D0\u0667\u05EA", // in the // middle - {"a7\u0667z", "B", "a7\u0667z", Uts46.UIDNA_ERROR_BIDI}, // AN + "a7\u0667z", // digit // in LTR - { - "\u05D07\u0667\u05EA", - "B", // mixed EN/AN digits in RTL - "\u05D07\u0667\u05EA", - Uts46.UIDNA_ERROR_BIDI - }, - // ZWJ - {"\u0BB9\u0BCD\u200D", "N", "\u0BB9\u0BCD\u200D", 0}, // Virama+ZWJ - {"\u0BB9\u200D", "N", "\u0BB9\u200D", Uts46.UIDNA_ERROR_CONTEXTJ}, // no - // Virama - {"\u200D", "N", "\u200D", Uts46.UIDNA_ERROR_CONTEXTJ}, // no + // mixed EN/AN digits in RTL + "\u05D07\u0667\u05EA", + // Virama+ZWJ + "\u0BB9\u0BCD\u200D", + "\u0BB9\u200D", // Virama - // ZWNJ - {"\u0BB9\u0BCD\u200C", "N", "\u0BB9\u0BCD\u200C", 0}, // Virama+ZWNJ - {"\u0BB9\u200C", "N", "\u0BB9\u200C", Uts46.UIDNA_ERROR_CONTEXTJ}, // no + "\u200D", + // Virama+ZWNJ + "\u0BB9\u0BCD\u200C", + "\u0BB9\u200C", // Virama - {"\u200C", "N", "\u200C", Uts46.UIDNA_ERROR_CONTEXTJ}, // no + "\u200C", // Virama - { - "\u0644\u0670\u200C\u06ED\u06EF", - "N", // Joining types D T ZWNJ T - // R - "\u0644\u0670\u200C\u06ED\u06EF", - 0 - }, - { - "\u0644\u0670\u200C\u06EF", - "N", // D T ZWNJ R - "\u0644\u0670\u200C\u06EF", - 0 - }, - { - "\u0644\u200C\u06ED\u06EF", - "N", // D ZWNJ T R - "\u0644\u200C\u06ED\u06EF", - 0 - }, - { - "\u0644\u200C\u06EF", - "N", // D ZWNJ R - "\u0644\u200C\u06EF", - 0 - }, - { - "\u0644\u0670\u200C\u06ED", - "N", // D T ZWNJ T - "\u0644\u0670\u200C\u06ED", - Uts46.UIDNA_ERROR_BIDI | Uts46.UIDNA_ERROR_CONTEXTJ - }, - { - "\u06EF\u200C\u06EF", - "N", // R ZWNJ R - "\u06EF\u200C\u06EF", - Uts46.UIDNA_ERROR_CONTEXTJ - }, - { - "\u0644\u200C", - "N", // D ZWNJ - "\u0644\u200C", - Uts46.UIDNA_ERROR_BIDI | Uts46.UIDNA_ERROR_CONTEXTJ - }, - // { "", "B", - // "", 0 }, - {"0à.\u05D0"}, - {"à.\u05D00\u0660"}, - {"a。。b"}, - {"\u200D。。\u06B9\u200C"}, - {"\u05D0\u0030\u0660"}, - {"$"}, + // Joining types D T ZWNJ T + "\u0644\u0670\u200C\u06ED\u06EF", + // D T ZWNJ R + "\u0644\u0670\u200C\u06EF", + // D ZWNJ T R + "\u0644\u200C\u06ED\u06EF", + // D ZWNJ R + "\u0644\u200C\u06EF", + // D T ZWNJ T + "\u0644\u0670\u200C\u06ED", + // R ZWNJ R + "\u06EF\u200C\u06EF", + // D ZWNJ + "\u0644\u200C", + "0à.\u05D0", + "à.\u05D00\u0660", + "a。。b", + "\u200D。。\u06B9\u200C", + "\u05D0\u0030\u0660", + "$", }; }