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

Side by Side Diff: utils/tests/pub/path/path_posix_test.dart

Issue 11557008: Make pub publish more user friendly: (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge in path changes. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/tests/pub/oauth2_test.dart ('k') | utils/tests/pub/path/path_windows_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; 5 library path_test;
6 6
7 import 'dart:io' as io; 7 import 'dart:io' as io;
8 8
9 import '../../../../pkg/unittest/lib/unittest.dart'; 9 import '../../../../pkg/unittest/lib/unittest.dart';
10 import '../../../pub/path.dart' as path; 10 import '../../../pub/path.dart' as path;
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 }); 146 });
147 147
148 test('disallows intermediate nulls', () { 148 test('disallows intermediate nulls', () {
149 expect(() => builder.join('a', null, 'b'), throwsArgumentError); 149 expect(() => builder.join('a', null, 'b'), throwsArgumentError);
150 expect(() => builder.join(null, 'a'), throwsArgumentError); 150 expect(() => builder.join(null, 'a'), throwsArgumentError);
151 }); 151 });
152 }); 152 });
153 153
154 group('split', () { 154 group('split', () {
155 test('simple cases', () { 155 test('simple cases', () {
156 expect(builder.split(''), []);
157 expect(builder.split('.'), ['.']);
158 expect(builder.split('..'), ['..']);
156 expect(builder.split('foo'), equals(['foo'])); 159 expect(builder.split('foo'), equals(['foo']));
157 expect(builder.split('foo/bar'), equals(['foo', 'bar'])); 160 expect(builder.split('foo/bar.txt'), equals(['foo', 'bar.txt']));
158 expect(builder.split('foo/bar/baz'), equals(['foo', 'bar', 'baz'])); 161 expect(builder.split('foo/bar/baz'), equals(['foo', 'bar', 'baz']));
159 expect(builder.split('foo/../bar/./baz'), 162 expect(builder.split('foo/../bar/./baz'),
160 equals(['foo', '..', 'bar', '.', 'baz'])); 163 equals(['foo', '..', 'bar', '.', 'baz']));
161 expect(builder.split('foo//bar///baz'), equals(['foo', 'bar', 'baz'])); 164 expect(builder.split('foo//bar///baz'), equals(['foo', 'bar', 'baz']));
162 expect(builder.split('foo/\\/baz'), equals(['foo', '\\', 'baz'])); 165 expect(builder.split('foo/\\/baz'), equals(['foo', '\\', 'baz']));
163 expect(builder.split('.'), equals(['.'])); 166 expect(builder.split('.'), equals(['.']));
164 expect(builder.split(''), equals([])); 167 expect(builder.split(''), equals([]));
165 expect(builder.split('foo/'), equals(['foo'])); 168 expect(builder.split('foo/'), equals(['foo']));
166 expect(builder.split('//'), equals(['/'])); 169 expect(builder.split('//'), equals(['/']));
167 }); 170 });
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 expect(builder.withoutExtension('a/'), 'a/'); 352 expect(builder.withoutExtension('a/'), 'a/');
350 expect(builder.withoutExtension('a/b/'), 'a/b/'); 353 expect(builder.withoutExtension('a/b/'), 'a/b/');
351 expect(builder.withoutExtension('a/.'), 'a/.'); 354 expect(builder.withoutExtension('a/.'), 'a/.');
352 expect(builder.withoutExtension('a/.b'), 'a/.b'); 355 expect(builder.withoutExtension('a/.b'), 'a/.b');
353 expect(builder.withoutExtension('a.b/c'), 'a.b/c'); 356 expect(builder.withoutExtension('a.b/c'), 'a.b/c');
354 expect(builder.withoutExtension(r'a.b\c'), r'a'); 357 expect(builder.withoutExtension(r'a.b\c'), r'a');
355 expect(builder.withoutExtension(r'a/b\c'), r'a/b\c'); 358 expect(builder.withoutExtension(r'a/b\c'), r'a/b\c');
356 expect(builder.withoutExtension(r'a/b\c.d'), r'a/b\c'); 359 expect(builder.withoutExtension(r'a/b\c.d'), r'a/b\c');
357 }); 360 });
358 } 361 }
OLDNEW
« no previous file with comments | « utils/tests/pub/oauth2_test.dart ('k') | utils/tests/pub/path/path_windows_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698