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

Unified Diff: dart/tests/try/poi/source_update_test.dart

Issue 814013002: Support functions for testing multiple files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42455. Created 6 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 | « dart/tests/try/poi/source_update.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/try/poi/source_update_test.dart
diff --git a/dart/tests/try/poi/source_update_test.dart b/dart/tests/try/poi/source_update_test.dart
index 0f98ce838c818b068f17b6ab89bbab913ac45761..9bd2893bf9088a8bdf3ca9ec19f73734dcc1f034 100644
--- a/dart/tests/try/poi/source_update_test.dart
+++ b/dart/tests/try/poi/source_update_test.dart
@@ -5,11 +5,16 @@
/// Test [source_update.dart].
library trydart.source_update_test;
+import 'dart:convert' show
+ JSON;
+
import 'package:expect/expect.dart' show
Expect;
import 'source_update.dart' show
- expandUpdates;
+ expandUpdates,
+ splitFiles,
+ splitLines;
main() {
Expect.listEquals(
@@ -27,4 +32,40 @@ main() {
Expect.throws(() {
expandUpdates(["head ", ["v1", "v2"], " tail ", ["v1", "v2", "v3"]]);
});
+
+ Expect.stringEquals(
+ JSON.encode({
+ "file1.dart": """
+First line of file 1.
+Second line of file 1.
+Third line of file 1.
+""",
+ "empty.dart":"",
+ "file2.dart":"""
+First line of file 2.
+Second line of file 2.
+Third line of file 2.
+"""}),
+
+ JSON.encode(splitFiles(r"""
+==> file1.dart <==
+First line of file 1.
+Second line of file 1.
+Third line of file 1.
+==> empty.dart <==
+==> file2.dart <==
+First line of file 2.
+Second line of file 2.
+Third line of file 2.
+""")));
+
+ Expect.stringEquals("{}", JSON.encode(splitFiles("")));
+
+ Expect.stringEquals("[]", JSON.encode(splitLines("")));
+
+ Expect.stringEquals('["1"]', JSON.encode(splitLines("1")));
+
+ Expect.stringEquals('["\\n"]', JSON.encode(splitLines("\n")));
+
+ Expect.stringEquals('["\\n","1"]', JSON.encode(splitLines("\n1")));
}
« no previous file with comments | « dart/tests/try/poi/source_update.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698