I decided to learn something new this evening so I started to read and write tests about URI
Now I have a question
testRelativeAuthority
"self debug: #testRelativeAuthority"
| uri relativeURIString |
"A relative URI with authority. relative uri does not start with a scheme:."
relativeURIString := '//www.pharo-project.org'.
uri := URI fromString: relativeURIString.
>>> self assert: (uri asString = relativeURIString).
Is false because
uri asString = 'www.pharo-project.org' and not '//www.pharo-project.org'
self deny: (uri isAbsolute).
self assert: (uri isRelative).
self assert: (uri authority asString = 'www.pharo-project.org').
self deny: (uri isOpaque).
So does anybody know what is correct?
Similarly
testRelativeEmptyAuthority
"self debug: #testRelativeEmptyAuthority"
| uri uriString |
uriString := '//'. "A relative URI with empty (but defined) authority."
uri := URI fromString: uriString.
self assert: (uri asString = uriString).
>>>
'' versus '//'
self deny: (uri isAbsolute).
self deny: (uri authority isNil).
self deny: (uri isOpaque).
Thanks
_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project