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

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

Issue 1842563003: Format everything in analyzer (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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
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 library analyzer.test.parse_compilation_unit_test; 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';
(...skipping 13 matching lines...) Expand all
24 return error is AnalyzerErrorGroup && 24 return error is AnalyzerErrorGroup &&
25 error.toString().contains("Error in test.dart: Expected to find ';'"); 25 error.toString().contains("Error in test.dart: Expected to find ';'");
26 }))); 26 })));
27 }); 27 });
28 28
29 test("defaults to '<unknown source>' if no name is provided", () { 29 test("defaults to '<unknown source>' if no name is provided", () {
30 expect(() { 30 expect(() {
31 parseCompilationUnit("void main() => print('Hello, world!')"); 31 parseCompilationUnit("void main() => print('Hello, world!')");
32 }, throwsA(predicate((error) { 32 }, throwsA(predicate((error) {
33 return error is AnalyzerErrorGroup && 33 return error is AnalyzerErrorGroup &&
34 error.toString().contains("Error in <unknown source>: Expected to find ';'"); 34 error
35 .toString()
36 .contains("Error in <unknown source>: Expected to find ';'");
35 }))); 37 })));
36 }); 38 });
37 39
38 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", () {
39 var unit = parseCompilationUnit("void main() => print('Hello, world!');", 41 var unit = parseCompilationUnit("void main() => print('Hello, world!');",
40 parseFunctionBodies: false); 42 parseFunctionBodies: false);
41 expect(unit.toString(), equals("void main();")); 43 expect(unit.toString(), equals("void main();"));
42 }); 44 });
43 } 45 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | pkg/analyzer/test/resource_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698