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

Unified Diff: tests/compiler/dart2js/backend_dart/sexpr2_test.dart

Issue 867233004: Support constructor declarations in analyzer2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/backend_dart/sexpr2_test.dart
diff --git a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
index 774f14278ee138b0b9b224f3a00c765f67572bbf..eef2d35728cc6beff2e13b2c54c87f08108486b0 100644
--- a/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
+++ b/tests/compiler/dart2js/backend_dart/sexpr2_test.dart
@@ -18,22 +18,33 @@ import 'test_helper.dart';
main() {
performTests(TEST_DATA, asyncTester, (TestSpec result) {
return compilerFor(result.input).then((Compiler compiler) {
- void checkOutput(Element element, String expectedOutput) {
+ void checkOutput(String elementName,
+ Element element,
+ String expectedOutput) {
expectedOutput = expectedOutput.trim();
String output = compiler.irBuilder.getIr(element)
.accept(new SExpressionStringifier()).trim();
Expect.equals(expectedOutput, output,
- '\nInput:\n${result.input}\n'
- 'Expected:\n$expectedOutput\n'
- 'Actual:\n$output\n');
+ "\nInput:\n${result.input}\n"
+ "Expected for '$elementName':\n$expectedOutput\n"
+ "Actual for '$elementName':\n$output\n");
}
if (result.output is String) {
- checkOutput(compiler.mainFunction, result.output);
+ checkOutput('main', compiler.mainFunction, result.output);
} else {
assert(result.output is Map<String, String>);
result.output.forEach((String elementName, String output) {
- checkOutput(compiler.mainApp.localLookup(elementName), output);
+ Element element;
+ if (elementName.contains('.')) {
+ ClassElement cls = compiler.mainApp.localLookup(
+ elementName.substring(0, elementName.indexOf('.')));
+ element = cls.localLookup(
+ elementName.substring(elementName.indexOf('.') + 1));
+ } else {
+ element = compiler.mainApp.localLookup(elementName);
+ }
+ checkOutput(elementName, element, output);
});
}
});
« pkg/compiler/lib/src/elements/modelx.dart ('K') | « pkg/compiler/lib/src/resolution/signatures.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698