| OLD | NEW |
| 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 library test.error; |
| 6 |
| 5 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 6 | 8 |
| 7 import 'utils.dart'; | 9 import 'utils.dart'; |
| 8 | 10 |
| 9 void main() { | 11 void main() { |
| 10 test("a valid Dart file doesn't throw any errors", () { | 12 test("a valid Dart file doesn't throw any errors", () { |
| 11 expect( | 13 expect( |
| 12 errorsForFile('void main() => print("Hello, world!");'), | 14 errorsForFile('void main() => print("Hello, world!");'), |
| 13 isNull); | 15 isNull); |
| 14 }); | 16 }); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 44 test("an error at the beginning of a very long line", () { | 46 test("an error at the beginning of a very long line", () { |
| 45 expect(errorsForFile('void foo; $veryLongString'), | 47 expect(errorsForFile('void foo; $veryLongString'), |
| 46 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); | 48 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); |
| 47 }); | 49 }); |
| 48 | 50 |
| 49 test("an error in the middle of a very long line", () { | 51 test("an error in the middle of a very long line", () { |
| 50 expect(errorsForFile('$veryLongString void foo;$veryLongString'), | 52 expect(errorsForFile('$veryLongString void foo;$veryLongString'), |
| 51 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); | 53 equals("Error in test.dart: Variables cannot have a type of 'void'\n")); |
| 52 }); | 54 }); |
| 53 } | 55 } |
| OLD | NEW |