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

Side by Side Diff: tests/language/if_flatten2_test.dart

Issue 288343014: dart2dart: Test cases for better code coverage in dart_tree rewritings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: SVN rebase Created 6 years, 7 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 | « tests/language/if_flatten1_test.dart ('k') | tests/language/logical_rewrite_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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:expect/expect.dart';
6
7 check_true_true(x, y) {
8 if (x) {
9 if (y) {
10 return true;
11 }
12 }
13 return false;
14 }
15
16 check_false_true(x, y) {
17 if (x) {
18
19 } else {
20 if (y) {
21 return true;
22 }
23 }
24 return false;
25 }
26
27 check_true_false(x, y) {
28 if (x) {
29 if (y) {
30
31 } else {
32 return true;
33 }
34 }
35 return false;
36 }
37
38 check_false_false(x, y) {
39 if (x) {
40
41 } else {
42 if (y) {
43
44 } else {
45 return true;
46 }
47 }
48 return false;
49 }
50
51
52 main() {
53 Expect.equals(true, check_true_true(true, true));
54 Expect.equals(false, check_true_true(true, false));
55 Expect.equals(false, check_true_true(false, true));
56 Expect.equals(false, check_true_true(false, false));
57
58 Expect.equals(false, check_true_false(true, true));
59 Expect.equals(true, check_true_false(true, false));
60 Expect.equals(false, check_true_false(false, true));
61 Expect.equals(false, check_true_false(false, false));
62
63 Expect.equals(false, check_false_true(true, true));
64 Expect.equals(false, check_false_true(true, false));
65 Expect.equals(true, check_false_true(false, true));
66 Expect.equals(false, check_false_true(false, false));
67
68 Expect.equals(false, check_false_false(true, true));
69 Expect.equals(false, check_false_false(true, false));
70 Expect.equals(false, check_false_false(false, true));
71 Expect.equals(true, check_false_false(false, false));
72 }
OLDNEW
« no previous file with comments | « tests/language/if_flatten1_test.dart ('k') | tests/language/logical_rewrite_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698