Chromium Code Reviews| Index: tests/compiler/dart2js/trust_type_annotations2_test.dart |
| diff --git a/tests/compiler/dart2js/trust_type_annotations2_test.dart b/tests/compiler/dart2js/trust_type_annotations2_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8ec4040753c325de039ff1bc9bfd726794357b9f |
| --- /dev/null |
| +++ b/tests/compiler/dart2js/trust_type_annotations2_test.dart |
| @@ -0,0 +1,32 @@ |
| +// Copyright (c) 2014, 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. |
| + |
| +import 'package:expect/expect.dart'; |
| +import "package:async_helper/async_helper.dart"; |
| +import 'compiler_helper.dart'; |
| + |
| +const String TEST = """ |
| + |
| +foo(int x, int y) { |
| + return x + y; |
| +} |
| + |
| +main (x, y) { |
| + if (x != null) { |
| + if (y != null) { |
| + return foo(x, y); |
| + } |
| + } |
| +} |
| +"""; |
| + |
| +main() { |
| + Uri uri = new Uri(scheme: 'source'); |
| + var compiler = compilerFor(TEST, uri, disableInlining: false/*, trustTypeAnnotations: true*/); |
|
floitsch
2014/11/06 16:57:52
I know, long line.
I will update the test. At the
|
| + asyncTest(() => compiler.runCompiler(uri).then((_) { |
| + var element = compiler.mainApp.findExported('main'); |
| + var code = compiler.backend.assembleCode(element); |
| + Expect.isTrue(code.contains('+')); |
| + })); |
| +} |