diff tests/test-url.py @ 15018:e89f62dcd723 stable

url: really handle urls of the form file:///c:/foo/bar/ correctly 28edd65000d9 made sure that paths that seemed to start with a windows drive letter would not get an extra leading slash. localpath should thus not try to handle this case by removing a leading slash, and this special handling is thus removed. (The localpath handling of this case was wrong anyway, because paths that look like they start with a windows drive letter can't have a leading slash.) A quick verification of this is to run 'hg id file:///c:/foo/bar/'.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 04 Aug 2011 02:51:29 +0200
parents 27b080aa880a
children 474279be5add
line wrap: on
line diff
--- a/tests/test-url.py	Mon Aug 01 18:09:20 2011 -0500
+++ b/tests/test-url.py	Thu Aug 04 02:51:29 2011 +0200
@@ -204,18 +204,32 @@
     <url scheme: 'file', path: '/foo/bar/baz'>
     >>> str(u)
     'file:///foo/bar/baz'
+    >>> u.localpath()
+    '/foo/bar/baz'
 
     >>> u = url('file:///foo/bar/baz')
     >>> u
     <url scheme: 'file', path: '/foo/bar/baz'>
     >>> str(u)
     'file:///foo/bar/baz'
+    >>> u.localpath()
+    '/foo/bar/baz'
+
+    >>> u = url('file:///f:oo/bar/baz')
+    >>> u
+    <url scheme: 'file', path: 'f:oo/bar/baz'>
+    >>> str(u)
+    'file:f%3Aoo/bar/baz'
+    >>> u.localpath()
+    'f:oo/bar/baz'
 
     >>> u = url('file:foo/bar/baz')
     >>> u
     <url scheme: 'file', path: 'foo/bar/baz'>
     >>> str(u)
     'file:foo/bar/baz'
+    >>> u.localpath()
+    'foo/bar/baz'
     """
 
 doctest.testmod(optionflags=doctest.NORMALIZE_WHITESPACE)