OLD | NEW |
(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 } |
OLD | NEW |