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

Unified Diff: pkg/pathos/test/pathos_url_test.dart

Issue 15967012: Make pathos run in the browser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Bug fix. Created 7 years, 6 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: pkg/pathos/test/pathos_url_test.dart
diff --git a/pkg/pathos/test/pathos_url_test.dart b/pkg/pathos/test/pathos_url_test.dart
index f419af4a873204ab985f8f55a706a20dbf2d000b..b8c100f27afe4613a573dadec3824b86b2ee1f69 100644
--- a/pkg/pathos/test/pathos_url_test.dart
+++ b/pkg/pathos/test/pathos_url_test.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'dart:io' as io;
-
import 'package:unittest/unittest.dart';
import 'package:pathos/path.dart' as path;
@@ -436,6 +434,16 @@ main() {
expect(builder.relative('../a/b.txt'), '../a/b.txt');
expect(builder.relative('a/./b/../c.txt'), 'a/c.txt');
});
+
+ // Regression
+ test('from root-only path', () {
+ expect(builder.relative('http://dartlang.org',
+ from: 'http://dartlang.org'),
+ '.');
+ expect(builder.relative('http://dartlang.org/root/path',
+ from: 'http://dartlang.org'),
+ 'root/path');
+ });
});
group('from relative root', () {
@@ -555,6 +563,15 @@ main() {
expect(r.relative('..', from: 'foo/bar'), equals('../../..'));
});
+
+ test('from a . root', () {
+ var r = new path.Builder(style: path.Style.url, root: '.');
+ expect(r.relative('http://dartlang.org/foo/bar/baz'),
+ equals('http://dartlang.org/foo/bar/baz'));
+ expect(r.relative('file:///foo/bar/baz'), equals('file:///foo/bar/baz'));
+ expect(r.relative('/foo/bar/baz'), equals('/foo/bar/baz'));
+ expect(r.relative('foo/bar/baz'), equals('foo/bar/baz'));
+ });
});
group('resolve', () {

Powered by Google App Engine
This is Rietveld 408576698