Chromium Code Reviews| 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..2b885276632b51dc3cf2b6a944f632ed5cca39b0 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""" |
|
Johnni Winther
2014/12/18 11:19:46
Indent by 6.
ahe
2014/12/18 11:35:13
Done.
|
| +==> 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"))); |
| } |