whois-server-list / public-suffix-list

Java API for Mozilla's Public Suffix List
Do What The F*ck You Want To Public License
46 stars 14 forks source link

registrableDomain() fails the test #1

Closed chetankothari closed 10 years ago

chetankothari commented 10 years ago

According to the test provided here one test fails, checkPublicSuffix('example.COM', 'example.com');

malkusch commented 10 years ago

The checkPublicSuffix()-Tests are all covered in GetRegistrableDomainTest.

checkPublicSuffix() assumes that the tested API does perform a canonicalization to the lower-case representation. The tested method in this API is PublicSuffixList.getRegistrableDomain(). This method is case insensitive, but does not return the canonicalized String. Therefore I have to canonicalize the test data. I.e. I am testing checkPublicSuffix('example.com', 'example.com')

chetankothari commented 10 years ago

So is there a method which cacnonicalizes the domain under consideration? Like i could just pass it a domain and the method takes care of canonicalizing it and then performing the validation.

malkusch commented 10 years ago

Every method of this API is case insensitive. If you want to do validation, I assume you whant to use one of the is… methods. They both accept the domain in a case insensitve way. What exactly are you missing?