mirror of
https://github.com/google/nomulus.git
synced 2025-04-30 03:57:51 +02:00
Allow two-letter domain names
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=130139005
This commit is contained in:
parent
5f26196993
commit
3efe09616c
2 changed files with 5 additions and 8 deletions
|
@ -163,8 +163,8 @@ public final class ReservedList
|
||||||
*/
|
*/
|
||||||
public static ReservationType getReservation(String label, String tld) {
|
public static ReservationType getReservation(String label, String tld) {
|
||||||
checkNotNull(label, "label");
|
checkNotNull(label, "label");
|
||||||
if (label.length() == 0 || label.length() == 2) {
|
if (label.length() == 0) {
|
||||||
return FULLY_BLOCKED; // All 2-letter labels are FULLY_BLOCKED.
|
return FULLY_BLOCKED;
|
||||||
}
|
}
|
||||||
ReservedListEntry entry = getReservedListEntry(label, tld);
|
ReservedListEntry entry = getReservedListEntry(label, tld);
|
||||||
return (entry != null) ? entry.reservationType : UNRESERVED;
|
return (entry != null) ? entry.reservationType : UNRESERVED;
|
||||||
|
|
|
@ -81,12 +81,9 @@ public class ReservedListTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetReservation_twoLetterCodesAreAllReserved() {
|
public void testGetReservation_twoLetterCodesAreAvailable() {
|
||||||
// This isn't quite exhaustive but it's close.
|
for (String sld : ImmutableList.of("aa", "az", "zz", "91", "1n", "j5")) {
|
||||||
for (char c1 = 'a'; c1 <= 'z'; c1++) {
|
assertThat(getReservation(sld, "tld")).isEqualTo(UNRESERVED);
|
||||||
for (char c2 = 'a'; c2 <= 'z'; c2++) {
|
|
||||||
assertThat(getReservation("" + c1 + c2, "tld")).isEqualTo(FULLY_BLOCKED);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue