Skip to content

Commit

Permalink
Sort some lists, removing a duplicate.
Browse files Browse the repository at this point in the history
(The duplicate was `state.ca.us` in `SOMEWHERE_UNDER_PS`.)

PiperOrigin-RevId: 710062073
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Dec 27, 2024
1 parent a3e17c2 commit 9983175
Show file tree
Hide file tree
Showing 2 changed files with 200 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,63 +58,72 @@ public final class InternetDomainNameTest extends TestCase {

private static final ImmutableSet<String> VALID_NAME =
ImmutableSet.of(
"foo.com",
"f-_-o.cOM",
"f--1.com",
"f11-1.com",
"www",
// keep-sorted start
"123.cn",
"8server.shop",
"a" + DELTA + "b.com",
"abc.a23",
"biz.com.ua",
"x",
"fOo",
"f--1.com",
"f--o",
"f-_-o.cOM",
"f11-1.com",
"fOo",
"f_a",
"foo.com",
"foo.net.us\uFF61ocm",
"woo.com.",
"8server.shop",
"123.cn",
"a" + DELTA + "b.com",
ALMOST_TOO_MANY_LEVELS,
ALMOST_TOO_LONG);
"www",
"x",
ALMOST_TOO_LONG,
ALMOST_TOO_MANY_LEVELS
// keep-sorted end
);

private static final ImmutableSet<String> INVALID_NAME =
ImmutableSet.of(
"",
// keep-sorted start
" ",
"",
".",
"..",
"...",
"..bar.com",
"..quiffle.com",
".foo.com",
"127.0.0.1",
"::1",
"13",
"abc.12c",
"foo-.com",
"::1",
"_bar.quux",
"foo+bar.com",
"foo!bar.com",
".foo.com",
"..bar.com",
"a" + DELTA + " .com",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
"abc.12c",
"baz..com",
"..quiffle.com",
"fleeb.com..",
".",
"..",
"...",
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com",
"a" + DELTA + " .com",
ALMOST_TOO_MANY_LEVELS + "com",
ALMOST_TOO_LONG + ".c");
"foo!bar.com",
"foo+bar.com",
"foo-.com",
ALMOST_TOO_LONG + ".c",
ALMOST_TOO_MANY_LEVELS + "com"
// keep-sorted end
);

private static final ImmutableSet<String> RS =
ImmutableSet.of(
"com",
// keep-sorted start
"\u7f51\u7edc.Cn", // "网络.Cn"
"co.uk",
"co.uk.", // Trailing dot
"co\uFF61uk", // Alternate dot character
"com",
"foo.bd",
"xxxxxx.bd",
"org.mK",
"us",
"co.uk.", // Trailing dot
"co\uFF61uk", // Alternate dot character
"\u7f51\u7edc.Cn", // "网络.Cn"
"xxxxxx.bd",
// keep-sorted end
"j\u00f8rpeland.no", // "jorpeland.no" (first o slashed)
"xn--jrpeland-54a.no"); // IDNA (punycode) encoding of above
"xn--jrpeland-54a.no" // IDNA (punycode) encoding of above
);

private static final ImmutableSet<String> PS_NOT_RS =
ImmutableSet.of("blogspot.com", "blogspot.co.uk", "uk.com");
Expand All @@ -133,23 +142,26 @@ public final class InternetDomainNameTest extends TestCase {

private static final ImmutableSet<String> NON_PS =
ImmutableSet.of(
"foo.bar.com",
"foo.ca",
// keep-sorted start
"dominio.com.co",
"foo.bar.ca",
"foo.blogspot.com",
"foo.bar.co.il",
"foo.bar.com",
"foo.blogspot.co.uk",
"foo.blogspot.com",
"foo.ca",
"foo.eDu.au",
"foo.uk.com",
"foo.bar.co.il",
"state.CA.us",
"www.state.pa.us",
"pvt.k12.ca.us",
"www.google.com",
"www4.yahoo.co.uk",
"home.netscape.com",
"web.MIT.edu",
"foo.eDu.au",
"pvt.k12.ca.us",
"state.CA.us",
"utenti.blah.IT",
"dominio.com.co");
"web.MIT.edu",
"www.google.com",
"www.state.pa.us",
"www4.yahoo.co.uk"
// keep-sorted end
);

private static final ImmutableSet<String> NON_RS =
ImmutableSet.<String>builder().addAll(NON_PS).addAll(PS_NOT_RS).build();
Expand All @@ -175,63 +187,64 @@ public final class InternetDomainNameTest extends TestCase {

private static final ImmutableSet<String> SOMEWHERE_UNDER_PS =
ImmutableSet.of(
"foo.bar.google.com",
// keep-sorted start
"1.fm",
"a.b.c.1.2.3.ca.us",
"site.jp",
"uomi-online.kir.jp",
"a\u7f51\u7edcA.\u7f51\u7edc.Cn", // "a网络A.网络.Cn"
"cnn.ca",
"cool.co.uk",
"cool.de",
"cool.dk",
"cool.es",
"cool.nl",
"cool.se",
"cool\uFF61fr", // Alternate dot character
"foo.bar.google.com",
"google.Co.uK",
"google.com",
"home.netscape.com",
"it-trace.ch",
"jobs.kt.com.",
"jprs.co.jp",
"site.quick.jp",
"site.tenki.jp",
"site.or.jp",
"site.gr.jp",
"site.ne.jp",
"kt.co",
"ledger-enquirer.com",
"members.blah.nl.",
"pvt.k12.ca.us",
"site.ac.jp",
"site.ad.jp",
"site.ed.jp",
"site.geo.jp",
"site.go.jp",
"site.lg.jp",
"1.fm",
"site.cc",
"site.ed.jp",
"site.ee",
"site.fi",
"site.fm",
"site.geo.jp",
"site.go.jp",
"site.gr",
"www.leguide.ma",
"site.gr.jp",
"site.jp",
"site.lg.jp",
"site.ma",
"some.org.mk",
"site.mk",
"site.ne.jp",
"site.or.jp",
"site.quick.jp",
"site.tenki.jp",
"site.tv",
"site.us",
"www.odev.us",
"www.GOOGLE.com",
"www.com",
"google.com",
"www7.google.co.uk",
"google.Co.uK",
"jobs.kt.com.",
"home.netscape.com",
"web.stanford.edu",
"some.org.mk",
"stanford.edu",
"state.ca.us",
"www.state.ca.us",
"state.ca.us",
"pvt.k12.ca.us",
"www.rave.ca.",
"cnn.ca",
"ledger-enquirer.com",
"it-trace.ch",
"cool.dk",
"cool.co.uk",
"cool.de",
"cool.es",
"cool\uFF61fr", // Alternate dot character
"cool.nl",
"members.blah.nl.",
"cool.se",
"uomi-online.kir.jp",
"utenti.blah.it",
"kt.co",
"a\u7f51\u7edcA.\u7f51\u7edc.Cn" // "a网络A.网络.Cn"
"web.stanford.edu",
"www.GOOGLE.com",
"www.com",
"www.leguide.ma",
"www.odev.us",
"www.rave.ca.",
"www.state.ca.us",
"www7.google.co.uk"
// keep-sorted end
);

private static final ImmutableSet<String> SOMEWHERE_UNDER_RS =
Expand Down
Loading

0 comments on commit 9983175

Please sign in to comment.