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

Side by Side Diff: frog/tests/leg/src/TypeGuardUnuserTest.dart

Issue 9592009: Reapply "Refactor constant part." (r4958) with fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. Created 8 years, 9 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 | « frog/tests/leg/src/SsaPhiEliminatorTest.dart ('k') | frog/tests/leg/src/TypeInferenceTest.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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("compiler_helper.dart"); 5 #import("compiler_helper.dart");
6 6
7 final String TEST_ONE = @""" 7 final String TEST_ONE = @"""
8 foo(a) { 8 foo(a) {
9 int c = foo(1); 9 int c = foo(1);
10 if (a) c = foo(2); 10 if (a) c = foo(2);
(...skipping 22 matching lines...) Expand all
33 main() { 33 main() {
34 String generated = compile(TEST_ONE, 'foo'); 34 String generated = compile(TEST_ONE, 'foo');
35 RegExp regexp = new RegExp(getIntTypeCheck(anyIdentifier)); 35 RegExp regexp = new RegExp(getIntTypeCheck(anyIdentifier));
36 Iterator<Match> matches = regexp.allMatches(generated).iterator(); 36 Iterator<Match> matches = regexp.allMatches(generated).iterator();
37 checkNumberOfMatches(matches, 0); 37 checkNumberOfMatches(matches, 0);
38 38
39 regexp = const RegExp("return c;"); 39 regexp = const RegExp("return c;");
40 Expect.isTrue(regexp.hasMatch(generated)); 40 Expect.isTrue(regexp.hasMatch(generated));
41 41
42 generated = compile(TEST_TWO, 'foo'); 42 generated = compile(TEST_TWO, 'foo');
43 regexp = const RegExp("foo\\\$1\\(1\\)"); 43 regexp = const RegExp("foo\\\$1\\(\\(1\\)\\)");
44 matches = regexp.allMatches(generated).iterator(); 44 matches = regexp.allMatches(generated).iterator();
45 checkNumberOfMatches(matches, 1); 45 checkNumberOfMatches(matches, 1);
46 46
47 generated = compile(TEST_THREE, 'foo'); 47 generated = compile(TEST_THREE, 'foo');
48 regexp = new RegExp(getIntTypeCheck('param1')); 48 regexp = new RegExp(getIntTypeCheck('param1'));
49 Expect.isTrue(regexp.hasMatch(generated)); 49 Expect.isTrue(regexp.hasMatch(generated));
50 regexp = new RegExp(getIntTypeCheck('param2')); 50 regexp = new RegExp(getIntTypeCheck('param2'));
51 Expect.isTrue(regexp.hasMatch(generated)); 51 Expect.isTrue(regexp.hasMatch(generated));
52 } 52 }
OLDNEW
« no previous file with comments | « frog/tests/leg/src/SsaPhiEliminatorTest.dart ('k') | frog/tests/leg/src/TypeInferenceTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698