Files
sdk/tests/compiler/dart2js/codegen/field_codegen_test.dart
T
Johnni Winther c563d7845b Move unittests, part #5 of ?
Change-Id: I38c6a3f9c6c2620cc893ddef23bdc1e3a8bcb411
Reviewed-on: https://dart-review.googlesource.com/31061
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2017-12-22 12:23:38 +00:00

41 lines
1.2 KiB
Dart

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
// Test that parameters keep their names in the output.
import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import '../compiler_helper.dart';
const String TEST_NULL0 = r"""
class A { static var x; }
main() { return A.x; }
""";
const String TEST_NULL1 = r"""
var x;
main() { return x; }
""";
main() {
runTests({bool useKernel}) async {
CompileMode compileMode =
useKernel ? CompileMode.kernel : CompileMode.memory;
String generated1 = await compileAll(TEST_NULL0, compileMode: compileMode);
Expect.isTrue(generated1.contains("null"));
String generated2 = await compileAll(TEST_NULL1, compileMode: compileMode);
Expect.isTrue(generated2.contains("null"));
}
asyncTest(() async {
print('--test from ast---------------------------------------------------');
await runTests(useKernel: false);
print('--test from kernel------------------------------------------------');
await runTests(useKernel: true);
});
}