Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I assume he meant to extract the SLD, but I agree this should be clarified in the description.
Furthermore I have to say, that testcases would be nice and you should also include the original URLs in the optional message.
test.assert_equals(domain_name("http://example.com"), "example", "Testing http://example.com")
The task is misleading and the tests are flawed in many ways. The domain name for
http://google.com
isgoogle.com
notgoogle
. In that example,google
is theSLD
andcom
is theTLD
, see wikipedia for reference. The description should specify what are we looking for in a way that it doesn't provide a bad example (calling theSLD
thedomain name
).Due to this it also fails to categorise things such as
example.co.uk
. From the description I'd assume in this case we are looking to returnexample
, however that would be quite hard to tell as in truth theSLD
here isco
.The tests don't cover many cases, for example (ignoring my note above about the invalidity of the task itself):