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

Side by Side Diff: tests/compiler/dart2js/kernel/visitor_test.dart

Issue 2392943003: Handle const constructor invocation in kernel_impact. (Closed)
Patch Set: Updated cf. comments. Created 4 years, 2 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 | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// Test that the dart2js copy of [KernelVisitor] generates the expected IR as 5 /// Test that the dart2js copy of [KernelVisitor] generates the expected IR as
6 /// defined by kernel spec-mode test files. 6 /// defined by kernel spec-mode test files.
7 7
8 import 'dart:io'; 8 import 'dart:io';
9 import 'package:compiler/src/compiler.dart' show Compiler; 9 import 'package:compiler/src/compiler.dart' show Compiler;
10 import 'package:compiler/src/elements/elements.dart'; 10 import 'package:compiler/src/elements/elements.dart';
(...skipping 23 matching lines...) Expand all
34 if (arguments.isNotEmpty) continue; 34 if (arguments.isNotEmpty) continue;
35 if (SKIP_TESTS.contains(name)) continue; 35 if (SKIP_TESTS.contains(name)) continue;
36 } 36 }
37 37
38 test(name, () async { 38 test(name, () async {
39 LibraryElement library = await compiler.analyzeUri(file.absolute.uri); 39 LibraryElement library = await compiler.analyzeUri(file.absolute.uri);
40 JavaScriptBackend backend = compiler.backend; 40 JavaScriptBackend backend = compiler.backend;
41 StringBuffer buffer = new StringBuffer(); 41 StringBuffer buffer = new StringBuffer();
42 Program program = backend.kernelTask.buildProgram(library); 42 Program program = backend.kernelTask.buildProgram(library);
43 new MixinFullResolution().transform(program); 43 new MixinFullResolution().transform(program);
44 new Printer(buffer).writeLibraryFile( 44 new Printer(buffer)
45 program.mainMethod.enclosingLibrary); 45 .writeLibraryFile(program.mainMethod.enclosingLibrary);
46 String actual = buffer.toString(); 46 String actual = buffer.toString();
47 String expected = 47 String expected =
48 new File('${TESTCASE_DIR}/spec-mode/$name.baseline.txt') 48 new File('${TESTCASE_DIR}/spec-mode/$name.baseline.txt')
49 .readAsStringSync(); 49 .readAsStringSync();
50 if (selected) { 50 if (selected) {
51 String input = 51 String input =
52 new File('${TESTCASE_DIR}/input/$name.dart').readAsStringSync(); 52 new File('${TESTCASE_DIR}/input/$name.dart').readAsStringSync();
53 print('============================================================'); 53 print('============================================================');
54 print(name); 54 print(name);
55 print('--input-----------------------------------------------------'); 55 print('--input-----------------------------------------------------');
56 print(input); 56 print(input);
57 print('--expected--------------------------------------------------'); 57 print('--expected--------------------------------------------------');
58 print(expected); 58 print(expected);
59 print('--actual----------------------------------------------------'); 59 print('--actual----------------------------------------------------');
60 print(actual); 60 print(actual);
61 } 61 }
62 expect(actual, equals(expected)); 62 expect(actual, equals(expected));
63 }); 63 });
64 } 64 }
65 } 65 }
66 } 66 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698