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.parse.compilation.unit; | 5 library analyzer.test.parse_compilation_unit_test; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:unittest/unittest.dart'; |
9 | 9 |
10 import 'utils.dart'; | 10 import 'utils.dart'; |
11 | 11 |
12 void main() { | 12 void main() { |
13 initializeTestEnvironment(); | 13 initializeTestEnvironment(); |
14 test("parses a valid compilation unit successfully", () { | 14 test("parses a valid compilation unit successfully", () { |
15 var unit = parseCompilationUnit("void main() => print('Hello, world!');"); | 15 var unit = parseCompilationUnit("void main() => print('Hello, world!');"); |
(...skipping 20 matching lines...) Expand all Loading... |
36 .contains("Error in <unknown source>: Expected to find ';'"); | 36 .contains("Error in <unknown source>: Expected to find ';'"); |
37 }))); | 37 }))); |
38 }); | 38 }); |
39 | 39 |
40 test("allows you to specify whether or not to parse function bodies", () { | 40 test("allows you to specify whether or not to parse function bodies", () { |
41 var unit = parseCompilationUnit("void main() => print('Hello, world!');", | 41 var unit = parseCompilationUnit("void main() => print('Hello, world!');", |
42 parseFunctionBodies: false); | 42 parseFunctionBodies: false); |
43 expect(unit.toString(), equals("void main();")); | 43 expect(unit.toString(), equals("void main();")); |
44 }); | 44 }); |
45 } | 45 } |
OLD | NEW |