Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: tests/compiler/dart2js/uri_extras_test.dart

Issue 189563004: Use '--source-map' and '--out' options to support source maps from non-commandline. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/uri_extras_test.dart
diff --git a/tests/compiler/dart2js/uri_extras_test.dart b/tests/compiler/dart2js/uri_extras_test.dart
index 70453846de5587ecf5df166a994a7cf5b89b6f47..477b84c3fd9fadc7f4fc67ff3022acf0e89ddd0f 100644
--- a/tests/compiler/dart2js/uri_extras_test.dart
+++ b/tests/compiler/dart2js/uri_extras_test.dart
@@ -14,38 +14,41 @@ void testRelativize() {
c(expected, base, path, false);
return;
}
- String r;
-
- r = relativize(Uri.parse('file:$base'),
- Uri.parse('file:$path'),
- isWindows);
- Expect.stringEquals(expected, r);
-
- r = relativize(Uri.parse('FILE:$base'),
- Uri.parse('FILE:$path'),
- isWindows);
- Expect.stringEquals(expected, r);
-
- r = relativize(Uri.parse('file:$base'),
- Uri.parse('FILE:$path'),
- isWindows);
- Expect.stringEquals(expected, r);
-
- r = relativize(Uri.parse('FILE:$base'),
- Uri.parse('file:$path'),
- isWindows);
- Expect.stringEquals(expected, r);
+
+ test(Uri base, Uri uri) {
+ String r = relativize(base, uri, isWindows);
+ Uri resolved = base.resolve(r);
+ Expect.equals(uri.scheme.toLowerCase(), resolved.scheme.toLowerCase());
+ if (isWindows) {
+ Expect.equals(uri.path.toLowerCase(), resolved.path.toLowerCase());
+ } else {
+ Expect.equals(uri.path, resolved.path);
+ }
+ Expect.stringEquals(expected, r);
+ }
+
+ test(Uri.parse('file:$base'),
+ Uri.parse('file:$path'));
+
+ test(Uri.parse('FILE:$base'),
+ Uri.parse('FILE:$path'));
+
+ test(Uri.parse('file:$base'),
+ Uri.parse('FILE:$path'));
+
+ test(Uri.parse('FILE:$base'),
+ Uri.parse('file:$path'));
}
c('bar', '/', '/bar', null);
- c('/bar', '/foo', '/bar', null);
+ c('bar', '/foo', '/bar', null);
c('/bar', '/foo/', '/bar', null);
c('bar', '///c:/', '///c:/bar', true);
- c('/c:/bar', '///c:/foo', '///c:/bar', true);
+ c('bar', '///c:/foo', '///c:/bar', true);
c('/c:/bar', '///c:/foo/', '///c:/bar', true);
c('BAR', '///c:/', '///c:/BAR', true);
- c('/c:/BAR', '///c:/foo', '///c:/BAR', true);
+ c('BAR', '///c:/foo', '///c:/BAR', true);
c('/c:/BAR', '///c:/foo/', '///c:/BAR', true);
c('../sdk/lib/_internal/compiler/implementation/dart2js.dart',
@@ -63,6 +66,29 @@ void testRelativize() {
c('/Users/person/file.dart', '/Users/other/', '/Users/person/file.dart',
true);
+
+ c('out.js.map', '/Users/person/out.js', '/Users/person/out.js.map', null);
+
+ c('../person/out.js.map',
+ '/Users/other/out.js',
+ '/Users/person/out.js.map', false);
+
+ c('/Users/person/out.js.map',
+ '/Users/other/out.js',
+ '/Users/person/out.js.map', true);
+
+ c('out.js', '/Users/person/out.js.map', '/Users/person/out.js', null);
+
+ c('../person/out.js',
+ '/Users/other/out.js.map',
+ '/Users/person/out.js', false);
+
+ c('/Users/person/out.js',
+ '/Users/other/out.js.map',
+ '/Users/person/out.js', true);
+
+ c('out.js', '/out.js.map', '/out.js', null);
+
}
void main() {
« tests/compiler/dart2js/source_map_test.dart ('K') | « tests/compiler/dart2js/source_map_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698