Index: pkg/path/test/windows_test.dart |
diff --git a/pkg/path/test/windows_test.dart b/pkg/path/test/windows_test.dart |
index d19466356ad8465c187c283cd98d12034504da42..010cd351b30e75c605d7f0764801183367b42945 100644 |
--- a/pkg/path/test/windows_test.dart |
+++ b/pkg/path/test/windows_test.dart |
@@ -640,4 +640,33 @@ main() { |
expect(context.toUri(r'_{_}_`_^_ _"_%_'), |
Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')); |
}); |
+ |
+ group('formatUri', () { |
+ test('with a file: URI', () { |
+ expect(context.formatUri(Uri.parse('file:///C:/root/path/a/b')), r'a\b'); |
+ expect(context.formatUri(Uri.parse('file:///C:/other/path/a/b')), |
+ r'C:\other\path\a\b'); |
+ expect(context.formatUri(Uri.parse('file:///D:/root/path/a/b')), |
+ r'D:\root\path\a\b'); |
+ expect(context.formatUri(Uri.parse('file:///C:/root/other')), |
+ r'..\other'); |
+ }); |
+ |
+ test('with an http: URI', () { |
+ expect(context.formatUri(Uri.parse('http://dartlang.org/a/b')), |
+ 'http://dartlang.org/a/b'); |
+ }); |
+ |
+ test('with a relative URI', () { |
+ expect(context.formatUri(Uri.parse('a/b')), r'a\b'); |
+ }); |
+ |
+ test('with a root-relative URI', () { |
+ expect(context.formatUri(Uri.parse('/D:/a/b')), r'D:\a\b'); |
+ }); |
+ |
+ test('with a String', () { |
+ expect(context.formatUri('a/b'), r'a\b'); |
+ }); |
+ }); |
} |