From 4067301d23ac5c2c43a4da702b7ab92f89467fc0 Mon Sep 17 00:00:00 2001 From: cpovirk Date: Fri, 27 Dec 2024 09:27:15 -0800 Subject: [PATCH] Sort some lists, removing a duplicate. (The duplicate was `state.ca.us` in `SOMEWHERE_UNDER_PS`.) PiperOrigin-RevId: 710078801 --- .../common/net/InternetDomainNameTest.java | 187 ++++++++++-------- .../common/net/InternetDomainNameTest.java | 187 ++++++++++-------- 2 files changed, 200 insertions(+), 174 deletions(-) diff --git a/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java b/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java index eb75b1e5104c..0fdd2980fff6 100644 --- a/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java +++ b/android/guava-tests/test/com/google/common/net/InternetDomainNameTest.java @@ -58,63 +58,72 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 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 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 PS_NOT_RS = ImmutableSet.of("blogspot.com", "blogspot.co.uk", "uk.com"); @@ -133,23 +142,26 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 NON_RS = ImmutableSet.builder().addAll(NON_PS).addAll(PS_NOT_RS).build(); @@ -175,63 +187,64 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 SOMEWHERE_UNDER_RS = diff --git a/guava-tests/test/com/google/common/net/InternetDomainNameTest.java b/guava-tests/test/com/google/common/net/InternetDomainNameTest.java index eb75b1e5104c..0fdd2980fff6 100644 --- a/guava-tests/test/com/google/common/net/InternetDomainNameTest.java +++ b/guava-tests/test/com/google/common/net/InternetDomainNameTest.java @@ -58,63 +58,72 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 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 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 PS_NOT_RS = ImmutableSet.of("blogspot.com", "blogspot.co.uk", "uk.com"); @@ -133,23 +142,26 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 NON_RS = ImmutableSet.builder().addAll(NON_PS).addAll(PS_NOT_RS).build(); @@ -175,63 +187,64 @@ public final class InternetDomainNameTest extends TestCase { private static final ImmutableSet 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 SOMEWHERE_UNDER_RS =