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

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

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js/array_static_intercept_test.dart » ('j') | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // Test constant folding on numbers. 4 // Test constant folding on numbers.
5 5
6 import "package:expect/expect.dart"; 6 import 'dart:async';
7 import 'package:async_helper/async_helper.dart';
7 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
8 9
9 const String INT_PLUS_ZERO = """ 10 const String INT_PLUS_ZERO = """
10 int foo(x) => x; 11 int foo(x) => x;
11 void main() { 12 void main() {
12 var x = foo(0); 13 var x = foo(0);
13 return (x & 1) + 0; 14 return (x & 1) + 0;
14 } 15 }
15 """; 16 """;
16 17
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 int foo(x) => x; 68 int foo(x) => x;
68 void main() { 69 void main() {
69 var x = foo(0); 70 var x = foo(0);
70 return 1 * x; 71 return 1 * x;
71 } 72 }
72 """; 73 """;
73 74
74 main() { 75 main() {
75 var plusZero = new RegExp(r"\+ 0"); 76 var plusZero = new RegExp(r"\+ 0");
76 var zeroPlus = new RegExp(r"0 \+"); 77 var zeroPlus = new RegExp(r"0 \+");
77 compileAndDoNotMatch(INT_PLUS_ZERO, 'main', plusZero);
78 compileAndDoNotMatch(ZERO_PLUS_INT, 'main', zeroPlus);
79 compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero);
80 compileAndMatch(ZERO_PLUS_NUM, 'main', zeroPlus);
81
82 var timesOne = new RegExp(r"\* 1"); 78 var timesOne = new RegExp(r"\* 1");
83 var oneTimes = new RegExp(r"1 \*"); 79 var oneTimes = new RegExp(r"1 \*");
84 compileAndDoNotMatch(INT_TIMES_ONE, 'main', timesOne); 80
85 compileAndDoNotMatch(ONE_TIMES_INT, 'main', oneTimes); 81 asyncTest(() => Future.wait([
86 compileAndDoNotMatch(NUM_TIMES_ONE, 'main', timesOne); 82 compileAndDoNotMatch(INT_PLUS_ZERO, 'main', plusZero),
87 compileAndDoNotMatch(ONE_TIMES_NUM, 'main', oneTimes); 83 compileAndDoNotMatch(ZERO_PLUS_INT, 'main', zeroPlus),
84 compileAndMatch(NUM_PLUS_ZERO, 'main', plusZero),
85 compileAndMatch(ZERO_PLUS_NUM, 'main', zeroPlus),
86 compileAndDoNotMatch(INT_TIMES_ONE, 'main', timesOne),
87 compileAndDoNotMatch(ONE_TIMES_INT, 'main', oneTimes),
88 compileAndDoNotMatch(NUM_TIMES_ONE, 'main', timesOne),
89 compileAndDoNotMatch(ONE_TIMES_NUM, 'main', oneTimes),
90 ]));
88 } 91 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js/array_static_intercept_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698