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

Unified Diff: pkg/analyzer/test/generated/utilities_test.dart

Issue 1411253007: Extract 'computeLineStarts' utility. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Move into StringUtilities. Created 5 years, 2 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/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/utilities_test.dart
diff --git a/pkg/analyzer/test/generated/utilities_test.dart b/pkg/analyzer/test/generated/utilities_test.dart
index 24263e726e1c70fa6f4f2a9f3baad6b49c87f88b..c156aac637535e0bb0ce51bcfdf9f292f356ffc6 100644
--- a/pkg/analyzer/test/generated/utilities_test.dart
+++ b/pkg/analyzer/test/generated/utilities_test.dart
@@ -4566,6 +4566,21 @@ class SourceRangeTest {
@reflectiveTest
class StringUtilitiesTest {
+ void test_computeLineStarts_n() {
+ List<int> starts = StringUtilities.computeLineStarts('a\nbb\nccc');
+ expect(starts, <int>[0, 2, 5]);
+ }
+
+ void test_computeLineStarts_r() {
+ List<int> starts = StringUtilities.computeLineStarts('a\rbb\rccc');
+ expect(starts, <int>[0, 2, 5]);
+ }
+
+ void test_computeLineStarts_rn() {
+ List<int> starts = StringUtilities.computeLineStarts('a\r\nbb\r\nccc');
+ expect(starts, <int>[0, 3, 7]);
+ }
+
void test_EMPTY() {
expect(StringUtilities.EMPTY, "");
expect(StringUtilities.EMPTY.isEmpty, isTrue);
« no previous file with comments | « pkg/analyzer/lib/src/task/options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698