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

Side by Side Diff: pkg/analyzer/test/generated/utilities_string_test.dart

Issue 1411253007: Extract 'computeLineStarts' utility. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
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.
4
5 library test.engine.utilities.string;
6
7 import 'package:analyzer/src/generated/utilities_string.dart';
8 import 'package:unittest/unittest.dart';
9
10 import '../reflective_tests.dart';
11 import '../utils.dart';
12
13 main() {
14 initializeTestEnvironment();
15 runReflectiveTests(ComputeLineStartsTest);
16 }
17
18 @reflectiveTest
19 class ComputeLineStartsTest {
20 void test_n() {
21 List<int> starts = computeLineStarts('a\nbb\nccc');
22 expect(starts, <int>[0, 2, 5]);
23 }
24
25 void test_r() {
26 List<int> starts = computeLineStarts('a\rbb\rccc');
27 expect(starts, <int>[0, 2, 5]);
28 }
29
30 void test_rn() {
31 List<int> starts = computeLineStarts('a\r\nbb\r\nccc');
32 expect(starts, <int>[0, 3, 7]);
33 }
34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698