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

Side by Side Diff: pkg/analyzer_experimental/test/error_test.dart

Issue 45573002: Rename analyzer_experimental to analyzer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweaks before publishing. Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 import 'package:unittest/unittest.dart';
6
7 import 'utils.dart';
8
9 void main() {
10 test("a valid Dart file doesn't throw any errors", () {
11 expect(
12 errorsForFile('void main() => print("Hello, world!");'),
13 isNull);
14 });
15
16 test("an error on the first line", () {
17 expect(errorsForFile('void foo;\n'),
18 equals('Error on line 1 of test.dart: ...\n'
19 'void foo;\n'
20 '^^^^\n'));
21 });
22
23 test("an error on the last line", () {
24 expect(errorsForFile('\nvoid foo;'),
25 equals('Error on line 2 of test.dart: ...\n'
26 'void foo;\n'
27 '^^^^\n'));
28 });
29
30 test("an error in the middle", () {
31 expect(errorsForFile('\nvoid foo;\n'),
32 equals('Error on line 2 of test.dart: ...\n'
33 'void foo;\n'
34 '^^^^\n'));
35 });
36
37 var veryLongString = new List.filled(107, ' ').join('');
38
39 test("an error at the end of a very long line", () {
40 expect(errorsForFile('$veryLongString void foo;'),
41 equals('Error on line 1 of test.dart: ...\n'
42 '...$veryLongString void foo;\n'
43 '$veryLongString ^^^^\n'));
44 });
45
46 test("an error at the beginning of a very long line", () {
47 expect(errorsForFile('void foo; $veryLongString'),
48 equals('Error on line 1 of test.dart: ...\n'
49 'void foo; $veryLongString...\n'
50 '^^^^\n'));
51 });
52
53 test("an error in the middle of a very long line", () {
54 expect(errorsForFile('$veryLongString void foo;$veryLongString'),
55 equals('Error on line 1 of test.dart: ...\n'
56 '... '
57 'void foo; '
58 '...\n'
59 ' '
60 '^^^^\n'));
61 });
62 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/pubspec.yaml ('k') | pkg/analyzer_experimental/test/generated/ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698