Investigating, it turns out that UrlLike.fromURI doesn't seem prepared to deal with a url that's only an anchor (such as you'd have to navigate within the same page). It basically returns
new UrlLike(lowerCaseOrNull(uri.getScheme()), uri.getUserInfo(), uri.getHost(), uri.getAuthority(), uri.getPort(), pathOrDefault(uri.getPath()), uri.getQuery(), uri.getFragment());
which, in the case of a url consisting solely of of a fragment, uses a default path of "/".
Now, I'm happy to produce a pull request. I just want to make sure that this is not by design or something.
Yes, it's because there is a default path. It's not a common issue but if all other tests still pass after getting rid of the default path, I'd accept a pull request.
I bumped into the following inconsistency:
And indeed (which is what actually bit me):
Investigating, it turns out that UrlLike.fromURI doesn't seem prepared to deal with a url that's only an anchor (such as you'd have to navigate within the same page). It basically returns
which, in the case of a url consisting solely of of a fragment, uses a default path of "/".
Now, I'm happy to produce a pull request. I just want to make sure that this is not by design or something.