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

Unified Diff: pkg/pathos/test/pathos_posix_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_posix_test.dart
diff --git a/pkg/pathos/test/pathos_posix_test.dart b/pkg/pathos/test/pathos_posix_test.dart
index d6bfb913ad74872bcbfe34802ce11ef178440d71..ecdd1336ba3c39eac02bc4fda3edb9d663cf0121 100644
--- a/pkg/pathos/test/pathos_posix_test.dart
+++ b/pkg/pathos/test/pathos_posix_test.dart
@@ -4,8 +4,6 @@
library pathos_posix_test;
-import 'dart:io' as io;
-
import 'package:unittest/unittest.dart';
import 'package:pathos/path.dart' as path;
@@ -300,6 +298,12 @@ 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('/', from: '/'), '.');
+ expect(builder.relative('/root/path', from: '/'), 'root/path');
+ });
});
group('from relative root', () {
@@ -344,6 +348,12 @@ main() {
equals('/foo/bar/baz'));
expect(r.relative('..', from: 'foo/bar'), equals('../../..'));
});
+
+ test('from a . root', () {
+ var r = new path.Builder(style: path.Style.posix, root: '.');
+ 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