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

Side by Side Diff: test/codegen/common.dart

Issue 1016913002: pkg/smoke: support latest analyzer version and formatted code (Closed) Base URL: https://github.com/dart-lang/smoke@master
Patch Set: updates Created 5 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
« no previous file with comments | « pubspec.yaml ('k') | test/codegen/end_to_end_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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 smoke.test.codegen.common; 5 library smoke.test.codegen.common;
6 6
7 import 'package:smoke/codegen/generator.dart'; 7 import 'package:smoke/codegen/generator.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 checkResults(SmokeCodeGenerator generator, {List<String> imports: const [], 10 checkResults(SmokeCodeGenerator generator,
11 String topLevel: '', String initCall}) { 11 {List<String> imports: const [], String topLevel: '', String initCall}) {
12 var allImports = []..addAll(DEFAULT_IMPORTS)..addAll(imports)..add(''); 12 var allImports = []
13 ..addAll(DEFAULT_IMPORTS)
14 ..addAll(imports)
15 ..add('');
13 var genImports = new StringBuffer(); 16 var genImports = new StringBuffer();
14 generator.writeImports(genImports); 17 generator.writeImports(genImports);
15 expect(genImports.toString(), allImports.join('\n')); 18 expect(genImports.toString(), allImports.join('\n'));
16 19
17 var genTopLevel = new StringBuffer(); 20 var genTopLevel = new StringBuffer();
18 generator.writeTopLevelDeclarations(genTopLevel); 21 generator.writeTopLevelDeclarations(genTopLevel);
19 expect(genTopLevel.toString(), topLevel); 22 expect(genTopLevel.toString(), topLevel);
20 23
21 var indentedCode = initCall.replaceAll("\n", "\n ").trim(); 24 var indentedCode = initCall.replaceAll("\n", "\n ").trim();
22 var genInitCall = new StringBuffer(); 25 var genInitCall = new StringBuffer();
23 genInitCall.write(' useGeneratedCode('); 26 genInitCall.write(' useGeneratedCode(');
24 generator.writeStaticConfiguration(genInitCall); 27 generator.writeStaticConfiguration(genInitCall);
25 genInitCall.writeln(');'); 28 genInitCall.writeln(');');
26 expect(genInitCall.toString(), ' $indentedCode\n'); 29 expect(genInitCall.toString(), ' $indentedCode\n');
27 } 30 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | test/codegen/end_to_end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698