| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart_style.test.source_code_test; | 5 library dart_style.test.source_code_test; |
| 6 | 6 |
| 7 import 'package:test/test.dart'; | 7 import 'package:test/test.dart'; |
| 8 | 8 |
| 9 import 'package:dart_style/dart_style.dart'; | 9 import 'package:dart_style/dart_style.dart'; |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 var selection = new SourceCode("123456;", | 12 var selection = |
| 13 selectionStart: 3, selectionLength: 2); | 13 new SourceCode("123456;", selectionStart: 3, selectionLength: 2); |
| 14 var noSelection = new SourceCode("123456;"); | 14 var noSelection = new SourceCode("123456;"); |
| 15 | 15 |
| 16 group('constructor', () { | 16 group('constructor', () { |
| 17 test('throws on negative start', () { | 17 test('throws on negative start', () { |
| 18 expect(() { | 18 expect(() { |
| 19 new SourceCode("12345;", selectionStart: -1, selectionLength: 0); | 19 new SourceCode("12345;", selectionStart: -1, selectionLength: 0); |
| 20 }, throwsArgumentError); | 20 }, throwsArgumentError); |
| 21 }); | 21 }); |
| 22 | 22 |
| 23 test('throws on out of bounds start', () { | 23 test('throws on out of bounds start', () { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 group('textAfterSelection', () { | 74 group('textAfterSelection', () { |
| 75 test('gets substring after selection', () { | 75 test('gets substring after selection', () { |
| 76 expect(selection.textAfterSelection, equals("6;")); | 76 expect(selection.textAfterSelection, equals("6;")); |
| 77 }); | 77 }); |
| 78 | 78 |
| 79 test('gets empty string if no selection', () { | 79 test('gets empty string if no selection', () { |
| 80 expect(noSelection.textAfterSelection, equals("")); | 80 expect(noSelection.textAfterSelection, equals("")); |
| 81 }); | 81 }); |
| 82 }); | 82 }); |
| 83 } | 83 } |
| OLD | NEW |