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

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

Issue 11776008: 2nd Retry "Emit more stuff via ASTs" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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 // Test constant folding. 4 // Test constant folding.
5 5
6 library compiler_helper; 6 library compiler_helper;
7 7
8 import "dart:uri"; 8 import "dart:uri";
9 9
10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t" 10 import "../../../sdk/lib/_internal/compiler/implementation/elements/elements.dar t"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 return element; 71 return element;
72 } 72 }
73 73
74 String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*"; 74 String anyIdentifier = "[a-zA-Z][a-zA-Z0-9]*";
75 75
76 String getIntTypeCheck(String variable) { 76 String getIntTypeCheck(String variable) {
77 return "\\($variable ?!== ?\\($variable ?\\| ?0\\)\\)"; 77 return "\\($variable ?!== ?\\($variable ?\\| ?0\\)\\)";
78 } 78 }
79 79
80 String getNumberTypeCheck(String variable) { 80 String getNumberTypeCheck(String variable) {
81 return "\\(typeof $variable ?!== ?'number'\\)"; 81 return """\\(typeof $variable ?!== ?"number"\\)""";
82 } 82 }
83 83
84 bool checkNumberOfMatches(Iterator it, int nb) { 84 bool checkNumberOfMatches(Iterator it, int nb) {
85 for (int i = 0; i < nb; i++) { 85 for (int i = 0; i < nb; i++) {
86 Expect.isTrue(it.hasNext, "Found less than $nb matches"); 86 Expect.isTrue(it.hasNext, "Found less than $nb matches");
87 it.next(); 87 it.next();
88 } 88 }
89 Expect.isFalse(it.hasNext, "Found more than $nb matches"); 89 Expect.isFalse(it.hasNext, "Found more than $nb matches");
90 } 90 }
91 91
(...skipping 27 matching lines...) Expand all
119 final xRe = new RegExp('\\bx\\b'); 119 final xRe = new RegExp('\\bx\\b');
120 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)'); 120 regexp = regexp.replaceAll(xRe, '(?:$anyIdentifier)');
121 final spaceRe = new RegExp('\\s+'); 121 final spaceRe = new RegExp('\\s+');
122 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)'); 122 regexp = regexp.replaceAll(spaceRe, '(?:\\s*)');
123 if (shouldMatch) { 123 if (shouldMatch) {
124 Expect.isTrue(new RegExp(regexp).hasMatch(generated)); 124 Expect.isTrue(new RegExp(regexp).hasMatch(generated));
125 } else { 125 } else {
126 Expect.isFalse(new RegExp(regexp).hasMatch(generated)); 126 Expect.isFalse(new RegExp(regexp).hasMatch(generated));
127 } 127 }
128 } 128 }
129
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/class_codegen_test.dart ('k') | tests/compiler/dart2js/minify_many_locals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698