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

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

Issue 1459683003: `analyzer_cli` move to SDK. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: master merge 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
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | pkg/analyzer_cli/test/mocks.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 @TestOn("vm")
6
7 library analyzer_cli.test.error;
8
9 import 'package:test/test.dart';
10
11 import 'utils.dart';
12
13 void main() {
14 group('error', () {
15 test("a valid Dart file doesn't throw any errors", () {
16 expect(errorsForFile('void main() => print("Hello, world!");'), isNull);
17 });
18
19 test("an empty Dart file doesn't throw any errors", () {
20 expect(errorsForFile(''), isNull);
21 });
22
23 test("an error on the first line", () {
24 expect(errorsForFile('void foo;\n'), equals(
25 "Error in test.dart: Variables cannot have a type of 'void'\n"));
26 });
27
28 test("an error on the last line", () {
29 expect(errorsForFile('\nvoid foo;'), equals(
30 "Error in test.dart: Variables cannot have a type of 'void'\n"));
31 });
32
33 test("an error in the middle", () {
34 expect(errorsForFile('\nvoid foo;\n'), equals(
35 "Error in test.dart: Variables cannot have a type of 'void'\n"));
36 });
37
38 var veryLongString = new List.filled(107, ' ').join('');
39
40 test("an error at the end of a very long line", () {
41 expect(errorsForFile('$veryLongString void foo;'), equals(
42 "Error in test.dart: Variables cannot have a type of 'void'\n"));
43 });
44
45 test("an error at the beginning of a very long line", () {
46 expect(errorsForFile('void foo; $veryLongString'), equals(
47 "Error in test.dart: Variables cannot have a type of 'void'\n"));
48 });
49
50 test("an error in the middle of a very long line", () {
51 expect(errorsForFile('$veryLongString void foo;$veryLongString'), equals(
52 "Error in test.dart: Variables cannot have a type of 'void'\n"));
53 });
54 });
55 }
OLDNEW
« no previous file with comments | « pkg/analyzer_cli/test/driver_test.dart ('k') | pkg/analyzer_cli/test/mocks.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698