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

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

Issue 362043006: Add support in smoke for generating static configurations in pieces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 | « pkg/smoke/pubspec.yaml ('k') | pkg/smoke/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, {List<String> imports: const [],
11 String topLevel: '', String initCall}) { 11 String topLevel: '', String initCall}) {
12 var allImports = []..addAll(DEFAULT_IMPORTS)..addAll(imports)..add(''); 12 var allImports = []..addAll(DEFAULT_IMPORTS)..addAll(imports)..add('');
13 var genImports = new StringBuffer(); 13 var genImports = new StringBuffer();
14 generator.writeImports(genImports); 14 generator.writeImports(genImports);
15 expect(genImports.toString(), allImports.join('\n')); 15 expect(genImports.toString(), allImports.join('\n'));
16 16
17 var genTopLevel = new StringBuffer(); 17 var genTopLevel = new StringBuffer();
18 generator.writeTopLevelDeclarations(genTopLevel); 18 generator.writeTopLevelDeclarations(genTopLevel);
19 expect(genTopLevel.toString(), topLevel); 19 expect(genTopLevel.toString(), topLevel);
20 20
21 var indentedCode = initCall.replaceAll("\n", "\n ").trim(); 21 var indentedCode = initCall.replaceAll("\n", "\n ").trim();
22 var genInitCall = new StringBuffer(); 22 var genInitCall = new StringBuffer();
23 generator.writeInitCall(genInitCall); 23 genInitCall.write(' useGeneratedCode(');
24 generator.writeStaticConfiguration(genInitCall);
25 genInitCall.writeln(');');
24 expect(genInitCall.toString(), ' $indentedCode\n'); 26 expect(genInitCall.toString(), ' $indentedCode\n');
25 } 27 }
OLDNEW
« no previous file with comments | « pkg/smoke/pubspec.yaml ('k') | pkg/smoke/test/codegen/end_to_end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698