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

Unified Diff: utils/tests/pub/path/path_windows_test.dart

Issue 11471048: Revise path library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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
« no previous file with comments | « utils/tests/pub/path/path_posix_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/path/path_windows_test.dart
diff --git a/utils/tests/pub/path/path_windows_test.dart b/utils/tests/pub/path/path_windows_test.dart
index ecad7aace92c82690d55502a657e8febfa0bd869..013afb4f030b116ccdf625b29cca90391495f594 100644
--- a/utils/tests/pub/path/path_windows_test.dart
+++ b/utils/tests/pub/path/path_windows_test.dart
@@ -35,29 +35,29 @@ main() {
expect(builder.extension(r'a.b/c'), r'');
});
- test('filename', () {
- expect(builder.filename(r''), '');
- expect(builder.filename(r'a'), 'a');
- expect(builder.filename(r'a\b'), 'b');
- expect(builder.filename(r'a\b\c'), 'c');
- expect(builder.filename(r'a\b.c'), 'b.c');
- expect(builder.filename(r'a\'), '');
- expect(builder.filename(r'a/'), '');
- expect(builder.filename(r'a\.'), '.');
- expect(builder.filename(r'a\b/c'), r'c');
+ test('basename', () {
+ expect(builder.basename(r''), '');
+ expect(builder.basename(r'a'), 'a');
+ expect(builder.basename(r'a\b'), 'b');
+ expect(builder.basename(r'a\b\c'), 'c');
+ expect(builder.basename(r'a\b.c'), 'b.c');
+ expect(builder.basename(r'a\'), '');
+ expect(builder.basename(r'a/'), '');
+ expect(builder.basename(r'a\.'), '.');
+ expect(builder.basename(r'a\b/c'), r'c');
});
- test('filenameWithoutExtension', () {
- expect(builder.filenameWithoutExtension(''), '');
- expect(builder.filenameWithoutExtension('a'), 'a');
- expect(builder.filenameWithoutExtension(r'a\b'), 'b');
- expect(builder.filenameWithoutExtension(r'a\b\c'), 'c');
- expect(builder.filenameWithoutExtension(r'a\b.c'), 'b');
- expect(builder.filenameWithoutExtension(r'a\'), '');
- expect(builder.filenameWithoutExtension(r'a\.'), '.');
- expect(builder.filenameWithoutExtension(r'a\b/c'), r'c');
- expect(builder.filenameWithoutExtension(r'a\.bashrc'), '.bashrc');
- expect(builder.filenameWithoutExtension(r'a\b\c.d.e'), 'c.d');
+ test('basenameWithoutExtension', () {
+ expect(builder.basenameWithoutExtension(''), '');
+ expect(builder.basenameWithoutExtension('a'), 'a');
+ expect(builder.basenameWithoutExtension(r'a\b'), 'b');
+ expect(builder.basenameWithoutExtension(r'a\b\c'), 'c');
+ expect(builder.basenameWithoutExtension(r'a\b.c'), 'b');
+ expect(builder.basenameWithoutExtension(r'a\'), '');
+ expect(builder.basenameWithoutExtension(r'a\.'), '.');
+ expect(builder.basenameWithoutExtension(r'a\b/c'), r'c');
+ expect(builder.basenameWithoutExtension(r'a\.bashrc'), '.bashrc');
+ expect(builder.basenameWithoutExtension(r'a\b\c.d.e'), 'c.d');
});
test('isAbsolute', () {
@@ -206,6 +206,10 @@ main() {
expect(builder.relative(r'C:\root\a\b.txt'), r'..\a\b.txt');
});
+ test('given absolute path on different drive', () {
+ expect(builder.relative(r'D:\a\b'), r'D:\a\b');
+ });
+
test('given relative path', () {
// The path is considered relative to the root, so it basically just
// normalizes.
@@ -289,6 +293,7 @@ main() {
expect(builder.withoutExtension(r'a\.'), r'a\.');
expect(builder.withoutExtension(r'a\.b'), r'a\.b');
expect(builder.withoutExtension(r'a.b\c'), r'a.b\c');
+ expect(builder.withoutExtension(r'a/b.c/d'), r'a/b.c/d');
expect(builder.withoutExtension(r'a\b/c'), r'a\b/c');
expect(builder.withoutExtension(r'a\b/c.d'), r'a\b/c');
});
« no previous file with comments | « utils/tests/pub/path/path_posix_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698