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', () { |