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

Side by Side Diff: frog/tests/leg_only/operator3_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « frog/tests/leg_only/operator2_test.dart ('k') | frog/tests/leg_only/operator_equals_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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 int zero() { return 0; }
6 int one() { return 1; }
7 int minus1() { return 0 - 1; }
8 int two() { return 2; }
9 int three() { return 3; }
10 int five() { return 5; }
11 int minus5() { return 0 - 5; }
12 int ninetyNine() { return 99; }
13 int four99() { return 499; }
14 int four99times99() { return 499 * 99; }
15 int four99times99plus1() { return 499 * 99 + 1; }
16
17 void postPlusPlusTest() {
18 var x = zero();
19 var y = x++;
20 Expect.equals(0, y);
21 Expect.equals(1, x);
22 Expect.equals(1, x++);
23 Expect.equals(2, x);
24 }
25
26 void prePlusPlusTest() {
27 var x = zero();
28 var y = ++x;
29 Expect.equals(1, x);
30 Expect.equals(1, y);
31 Expect.equals(2, ++x);
32 Expect.equals(2, ++y);
33 }
34
35 void postMinusMinusTest() {
36 var x = four99();
37 var y = x--;
38 Expect.equals(499, y);
39 Expect.equals(498, x);
40 Expect.equals(498, x--);
41 Expect.equals(497, x);
42 }
43
44 void preMinusMinusTest() {
45 var x = four99();
46 var y = --x;
47 Expect.equals(498, y);
48 Expect.equals(498, x);
49 Expect.equals(497, --x);
50 Expect.equals(497, x);
51 }
52
53 void main() {
54 postPlusPlusTest();
55 prePlusPlusTest();
56 postMinusMinusTest();
57 preMinusMinusTest();
58 }
OLDNEW
« no previous file with comments | « frog/tests/leg_only/operator2_test.dart ('k') | frog/tests/leg_only/operator_equals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698