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

Side by Side Diff: test/windows_test.dart

Issue 837563005: fixed relative root tests (Closed) Base URL: https://github.com/dart-lang/path.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « test/url_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library path.test.windows_test; 5 library path.test.windows_test;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'package:path/path.dart' as path; 8 import 'package:path/path.dart' as path;
9 9
10 import 'utils.dart'; 10 import 'utils.dart';
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 expect(context.isWithin(r'C:\', r'D:\foo\bar'), isFalse); 532 expect(context.isWithin(r'C:\', r'D:\foo\bar'), isFalse);
533 expect(context.isWithin(r'C:\', r'\foo\bar'), isTrue); 533 expect(context.isWithin(r'C:\', r'\foo\bar'), isTrue);
534 expect(context.isWithin(r'C:\foo', r'\foo\bar'), isTrue); 534 expect(context.isWithin(r'C:\foo', r'\foo\bar'), isTrue);
535 expect(context.isWithin(r'C:\foo', r'\bar\baz'), isFalse); 535 expect(context.isWithin(r'C:\foo', r'\bar\baz'), isFalse);
536 expect(context.isWithin(r'baz', r'C:\root\path\baz\bang'), isTrue); 536 expect(context.isWithin(r'baz', r'C:\root\path\baz\bang'), isTrue);
537 expect(context.isWithin(r'baz', r'C:\root\path\bang\baz'), isFalse); 537 expect(context.isWithin(r'baz', r'C:\root\path\bang\baz'), isFalse);
538 }); 538 });
539 539
540 test('from a relative root', () { 540 test('from a relative root', () {
541 var r = new path.Context(style: path.Style.windows, current: r'foo\bar'); 541 var r = new path.Context(style: path.Style.windows, current: r'foo\bar');
542 expect(context.isWithin('.', r'a\b\c'), isTrue); 542 expect(r.isWithin('.', r'a\b\c'), isTrue);
543 expect(context.isWithin('.', r'..\a\b\c'), isFalse); 543 expect(r.isWithin('.', r'..\a\b\c'), isFalse);
544 expect(context.isWithin('.', r'..\..\a\foo\b\c'), isFalse); 544 expect(r.isWithin('.', r'..\..\a\foo\b\c'), isFalse);
545 expect(context.isWithin(r'C:\', r'C:\baz\bang'), isTrue); 545 expect(r.isWithin(r'C:\', r'C:\baz\bang'), isTrue);
546 expect(context.isWithin('.', r'C:\baz\bang'), isFalse); 546 expect(r.isWithin('.', r'C:\baz\bang'), isFalse);
547 }); 547 });
548 }); 548 });
549 549
550 group('absolute', () { 550 group('absolute', () {
551 test('allows up to seven parts', () { 551 test('allows up to seven parts', () {
552 expect(context.absolute('a'), r'C:\root\path\a'); 552 expect(context.absolute('a'), r'C:\root\path\a');
553 expect(context.absolute('a', 'b'), r'C:\root\path\a\b'); 553 expect(context.absolute('a', 'b'), r'C:\root\path\a\b');
554 expect(context.absolute('a', 'b', 'c'), r'C:\root\path\a\b\c'); 554 expect(context.absolute('a', 'b', 'c'), r'C:\root\path\a\b\c');
555 expect(context.absolute('a', 'b', 'c', 'd'), r'C:\root\path\a\b\c\d'); 555 expect(context.absolute('a', 'b', 'c', 'd'), r'C:\root\path\a\b\c\d');
556 expect(context.absolute('a', 'b', 'c', 'd', 'e'), 556 expect(context.absolute('a', 'b', 'c', 'd', 'e'),
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 test('with a root-relative URI', () { 668 test('with a root-relative URI', () {
669 expect(context.prettyUri('/D:/a/b'), r'D:\a\b'); 669 expect(context.prettyUri('/D:/a/b'), r'D:\a\b');
670 }); 670 });
671 671
672 test('with a Uri object', () { 672 test('with a Uri object', () {
673 expect(context.prettyUri(Uri.parse('a/b')), r'a\b'); 673 expect(context.prettyUri(Uri.parse('a/b')), r'a\b');
674 }); 674 });
675 }); 675 });
676 } 676 }
OLDNEW
« no previous file with comments | « test/url_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698