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

Unified Diff: frog/tests/leg/pretty_parameter_test.dart

Issue 10536169: Move frog/tests/{leg,leg_only,frog_native} to tests/compiler/. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/tests/leg/partial_parser_test.dart ('k') | frog/tests/leg/redundant_phi_eliminator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/tests/leg/pretty_parameter_test.dart
===================================================================
--- frog/tests/leg/pretty_parameter_test.dart (revision 8644)
+++ frog/tests/leg/pretty_parameter_test.dart (working copy)
@@ -1,110 +0,0 @@
-// Copyright (c) 2011, 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("compiler_helper.dart");
-
-final String FOO = @"""
-void foo(var a, var b) {
-}
-""";
-
-
-final String BAR = @"""
-void bar(var eval, var $eval) {
-}
-""";
-
-
-final String PARAMETER_AND_TEMP = @"""
-void bar(var t0, var b) {
- {
- var t0 = 2;
- if (b) {
- t0 = 4;
- } else {
- t0 = 3;
- }
- print(t0);
- }
- print(t0);
-}
-""";
-
-final String NO_LOCAL = @"""
-foo(bar, baz) {
- if (bar) {
- baz = 2;
- } else {
- baz = 3;
- }
- return baz;
-}
-""";
-
-final String MULTIPLE_PHIS_ONE_LOCAL = @"""
-foo(param1, param2, param3) {
- var a = 2;
- if (param1) {
- if (param2) {
- if (param3) {
- a = 42;
- }
- }
- }
- return a;
-}
-""";
-
-final String PARAMETER_INIT = @"""
-int foo(var start, bool test) {
- var result = start;
- if (test) {
- result = 42;
- }
- return result;
-}
-""";
-
-main() {
- String generated = compile(FOO, 'foo');
- // TODO(ngeoffray): Use 'contains' when frog supports it.
- RegExp regexp = const RegExp(@"function\(a, b\) {");
- Expect.isTrue(regexp.hasMatch(generated));
-
- generated = compile(BAR, 'bar');
- regexp = const RegExp(@"function\(eval\$, \$\$eval\) {");
- Expect.isTrue(regexp.hasMatch(generated));
-
- generated = compile(PARAMETER_AND_TEMP, 'bar');
- regexp = const RegExp(@"print\(t0\)");
- Expect.isTrue(regexp.hasMatch(generated));
- // Check that the second 't0' got another name.
- regexp = const RegExp(@"print\(t0_0\)");
- Expect.isTrue(regexp.hasMatch(generated));
-
- generated = compile(NO_LOCAL, 'foo');
- regexp = const RegExp("return baz");
- Expect.isTrue(regexp.hasMatch(generated));
- regexp = const RegExp(@"baz = 2");
- Expect.isTrue(regexp.hasMatch(generated));
- regexp = const RegExp(@"baz = 3");
- Expect.isTrue(regexp.hasMatch(generated));
- regexp = const RegExp("bar === true");
- Expect.isTrue(regexp.hasMatch(generated));
-
- generated = compile(MULTIPLE_PHIS_ONE_LOCAL, 'foo');
- regexp = const RegExp(@"var a = 2;");
- Expect.isTrue(regexp.hasMatch(generated));
-
- regexp = const RegExp(@"a = 2;");
- Iterator matches = regexp.allMatches(generated).iterator();
- Expect.isTrue(matches.hasNext());
- matches.next();
- Expect.isFalse(matches.hasNext());
-
- generated = compile(PARAMETER_INIT, 'foo');
- regexp = const RegExp("var result = start;");
- Expect.isTrue(regexp.hasMatch(generated));
-}
« no previous file with comments | « frog/tests/leg/partial_parser_test.dart ('k') | frog/tests/leg/redundant_phi_eliminator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698