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

Side by Side Diff: tests/compiler/dart2js/generate_at_use_site_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'package:expect/expect.dart'; 6 import 'package:expect/expect.dart';
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
9 9
10 const String FIB = r""" 10 const String FIB = r"""
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const String TEST = r""" 45 const String TEST = r"""
46 foo(a) { 46 foo(a) {
47 if (a is !int) throw a; 47 if (a is !int) throw a;
48 if (a < 0) throw a; 48 if (a < 0) throw a;
49 return a + a; 49 return a + a;
50 } 50 }
51 """; 51 """;
52 52
53 main() { 53 main() {
54 asyncTest(() => Future.wait([ 54 asyncTest(() => Future.wait([
55 // Make sure we don't introduce a new variable. 55 // Make sure we don't introduce a new variable.
56 compileAndDoNotMatch(FIB, 'fib', new RegExp("var $anyIdentifier =")), 56 compileAndDoNotMatch(FIB, 'fib', new RegExp("var $anyIdentifier =")),
57 57
58 compileAndDoNotMatch(BAR, 'bar', new RegExp("isLeaf")), 58 compileAndDoNotMatch(BAR, 'bar', new RegExp("isLeaf")),
59 59
60 compile(TEST, entry: 'foo', check: (String generated) { 60 compile(TEST, entry: 'foo', check: (String generated) {
61 Expect.isFalse(generated.contains('else')); 61 Expect.isFalse(generated.contains('else'));
62 // Regression check to ensure that there is no floating variable 62 // Regression check to ensure that there is no floating variable
63 // expression. 63 // expression.
64 Expect.isFalse(new RegExp('^[ ]*a;').hasMatch(generated)); 64 Expect.isFalse(new RegExp('^[ ]*a;').hasMatch(generated));
65 }), 65 }),
66 ])); 66 ]));
67 } 67 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/frontend_checker.dart ('k') | tests/compiler/dart2js/generate_code_with_compile_time_errors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698