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

Side by Side Diff: test/posix_test.dart

Issue 1225373003: Fix path.toUri for relative paths. (Closed) Base URL: git@github.com:dart-lang/path@master
Patch Set: merge Created 5 years, 5 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 | « pubspec.yaml ('k') | test/url_test.dart » ('j') | 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.posix_test; 5 library path.test.posix_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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 }); 492 });
493 493
494 test('with a string', () { 494 test('with a string', () {
495 expect(context.fromUri('file:///path/to/foo'), '/path/to/foo'); 495 expect(context.fromUri('file:///path/to/foo'), '/path/to/foo');
496 }); 496 });
497 }); 497 });
498 498
499 test('toUri', () { 499 test('toUri', () {
500 expect(context.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo')); 500 expect(context.toUri('/path/to/foo'), Uri.parse('file:///path/to/foo'));
501 expect(context.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/')); 501 expect(context.toUri('/path/to/foo/'), Uri.parse('file:///path/to/foo/'));
502 expect(context.toUri('path/to/foo/'), Uri.parse('path/to/foo/'));
502 expect(context.toUri('/'), Uri.parse('file:///')); 503 expect(context.toUri('/'), Uri.parse('file:///'));
503 expect(context.toUri('foo/bar'), Uri.parse('foo/bar')); 504 expect(context.toUri('foo/bar'), Uri.parse('foo/bar'));
504 expect(context.toUri('/path/to/foo#bar'), 505 expect(context.toUri('/path/to/foo#bar'),
505 Uri.parse('file:///path/to/foo%23bar')); 506 Uri.parse('file:///path/to/foo%23bar'));
506 expect(context.toUri(r'/_{_}_`_^_ _"_%_'), 507 expect(context.toUri(r'/_{_}_`_^_ _"_%_'),
507 Uri.parse('file:///_%7B_%7D_%60_%5E_%20_%22_%25_')); 508 Uri.parse('file:///_%7B_%7D_%60_%5E_%20_%22_%25_'));
508 expect(context.toUri(r'_{_}_`_^_ _"_%_'), 509 expect(context.toUri(r'_{_}_`_^_ _"_%_'),
509 Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_')); 510 Uri.parse('_%7B_%7D_%60_%5E_%20_%22_%25_'));
510 }); 511 });
511 512
(...skipping 16 matching lines...) Expand all
528 529
529 test('with a root-relative URI', () { 530 test('with a root-relative URI', () {
530 expect(context.prettyUri('/a/b'), '/a/b'); 531 expect(context.prettyUri('/a/b'), '/a/b');
531 }); 532 });
532 533
533 test('with a Uri object', () { 534 test('with a Uri object', () {
534 expect(context.prettyUri(Uri.parse('a/b')), 'a/b'); 535 expect(context.prettyUri(Uri.parse('a/b')), 'a/b');
535 }); 536 });
536 }); 537 });
537 } 538 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/url_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698