diff options
author | Andrey Sobolev <andrey.sobolev@xored.com> | 2015-09-29 11:44:04 +0600 |
---|---|---|
committer | Andrey Sobolev <andrey.sobolev@xored.com> | 2015-09-29 11:44:04 +0600 |
commit | 8b2c9964abf08b7746f6446cead4d4ac4e8c6c67 (patch) | |
tree | d73e77db681c55757d7a27f7e33cffd9e3a6f9ef /lib | |
parent | 76a49bfceacd78e8ff84aa164956d9a75e2eb251 (diff) | |
parent | d8a10457e21654272e9de67048182d845e87eb3a (diff) | |
download | Nim-8b2c9964abf08b7746f6446cead4d4ac4e8c6c67.tar.gz |
Merge remote-tracking branch 'nim-lang/devel' into emscripten-support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/uri.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/pure/uri.nim b/lib/pure/uri.nim index 492de3b46..abb1a462d 100644 --- a/lib/pure/uri.nim +++ b/lib/pure/uri.nim @@ -142,6 +142,7 @@ proc parseUri*(uri: string): Uri = parseUri(uri, result) proc removeDotSegments(path: string): string = + if path.len == 0: return "" var collection: seq[string] = @[] let endsWithSlash = path[path.len-1] == '/' var i = 0 @@ -432,3 +433,12 @@ when isMainModule: block: let test = parseUri("http://example.com/foo/") / "/bar/asd" doAssert test.path == "/foo/bar/asd" + + # removeDotSegments tests + block: + # empty test + doAssert removeDotSegments("") == "" + + # bug #3207 + block: + doAssert parseUri("http://qq/1").combine(parseUri("https://qqq")).`$` == "https://qqq" |