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

Unified Diff: pkg/path/test/posix_test.dart

Issue 19219002: Test empty strings arguments to path.join(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle trailing empty string args in path.join(). Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/path/lib/path.dart ('k') | pkg/path/test/url_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/test/posix_test.dart
diff --git a/pkg/path/test/posix_test.dart b/pkg/path/test/posix_test.dart
index f3232bc818e9f67a1812c2b57aefcfa3b6b29789..c26a5ba8969b15ac5d9b084b4da93d952e12b2f4 100644
--- a/pkg/path/test/posix_test.dart
+++ b/pkg/path/test/posix_test.dart
@@ -153,6 +153,14 @@ main() {
expect(builder.join('a', 'b', 'c', null, null), equals('a/b/c'));
});
+ test('ignores empty strings', () {
+ expect(builder.join(''), '');
+ expect(builder.join('', ''), '');
+ expect(builder.join('', 'a'), 'a');
+ expect(builder.join('a', '', 'b', '', '', '', 'c'), 'a/b/c');
+ expect(builder.join('a', 'b', ''), 'a/b');
+ });
+
test('disallows intermediate nulls', () {
expect(() => builder.join('a', null, 'b'), throwsArgumentError);
expect(() => builder.join(null, 'a'), throwsArgumentError);
« no previous file with comments | « pkg/path/lib/path.dart ('k') | pkg/path/test/url_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698