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

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

Issue 199543002: Addtional tests in options.dart to cover 'log' case, and other missed flag tests as they were added. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analyzer/test/options_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 import 'package:unittest/unittest.dart'; 5 import 'package:unittest/unittest.dart';
6 6
7 import 'utils.dart'; 7 import 'utils.dart';
8 8
9 void main() { 9 void main() {
10 test("a valid Dart file doesn't throw any errors", () { 10 test("a valid Dart file doesn't throw any errors", () {
11 expect( 11 expect(
12 errorsForFile('void main() => print("Hello, world!");'), 12 errorsForFile('void main() => print("Hello, world!");'),
13 isNull); 13 isNull);
14 }); 14 });
15 15
16 test("an empty Dart file doesn't throw any errors", () {
17 expect(
18 errorsForFile(''),
19 isNull);
20 });
21
16 test("an error on the first line", () { 22 test("an error on the first line", () {
17 expect(errorsForFile('void foo;\n'), 23 expect(errorsForFile('void foo;\n'),
18 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); 24 equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
19 }); 25 });
20 26
21 test("an error on the last line", () { 27 test("an error on the last line", () {
22 expect(errorsForFile('\nvoid foo;'), 28 expect(errorsForFile('\nvoid foo;'),
23 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); 29 equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
24 }); 30 });
25 31
(...skipping 12 matching lines...) Expand all
38 test("an error at the beginning of a very long line", () { 44 test("an error at the beginning of a very long line", () {
39 expect(errorsForFile('void foo; $veryLongString'), 45 expect(errorsForFile('void foo; $veryLongString'),
40 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); 46 equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
41 }); 47 });
42 48
43 test("an error in the middle of a very long line", () { 49 test("an error in the middle of a very long line", () {
44 expect(errorsForFile('$veryLongString void foo;$veryLongString'), 50 expect(errorsForFile('$veryLongString void foo;$veryLongString'),
45 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); 51 equals("Error in test.dart: Variables cannot have a type of 'void'\n"));
46 }); 52 });
47 } 53 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698