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

Side by Side Diff: test/source_code_test.dart

Issue 1182953003: Eat some dogfood! (Closed) Base URL: https://github.com/dart-lang/dart_style.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« lib/src/source_visitor.dart ('K') | « test/io_test.dart ('k') | web/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698