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

Side by Side Diff: tests/standalone/status_expression_test.dart

Issue 10891020: Update almost all tests (except co19) to use the new try-catch syntax. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge. Created 8 years, 3 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/standalone/out_of_memory_test.dart ('k') | no next file » | 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 #library("StatusExpressionTest"); 5 #library("StatusExpressionTest");
6 6
7 #import("../../tools/testing/dart/status_expression.dart"); 7 #import("../../tools/testing/dart/status_expression.dart");
8 8
9 9
10 class StatusExpressionTest { 10 class StatusExpressionTest {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 ["(", "\$", "arch", "==", "dartc", "||", "\$", "arch", "==", 54 ["(", "\$", "arch", "==", "dartc", "||", "\$", "arch", "==",
55 "chromium", ")", "&&", "\$", "mode", "==", "release"]); 55 "chromium", ")", "&&", "\$", "mode", "==", "release"]);
56 } 56 }
57 57
58 static void test3() { 58 static void test3() {
59 var thrown; 59 var thrown;
60 String input = @" $mode == debug && ($arch==chromium || *$arch == dartc)"; 60 String input = @" $mode == debug && ($arch==chromium || *$arch == dartc)";
61 Tokenizer tokenizer = new Tokenizer(input); 61 Tokenizer tokenizer = new Tokenizer(input);
62 try { 62 try {
63 tokenizer.tokenize(); 63 tokenizer.tokenize();
64 } catch (Exception e) { 64 } on Exception catch (e) {
65 thrown = e; 65 thrown = e;
66 } 66 }
67 Expect.equals("Syntax error in '$input'", thrown.toString()); 67 Expect.equals("Syntax error in '$input'", thrown.toString());
68 } 68 }
69 69
70 static void test4() { 70 static void test4() {
71 var thrown; 71 var thrown;
72 String input = 72 String input =
73 @"($arch == (-dartc || $arch == chromium) && $mode == release"; 73 @"($arch == (-dartc || $arch == chromium) && $mode == release";
74 Tokenizer tokenizer = new Tokenizer(input); 74 Tokenizer tokenizer = new Tokenizer(input);
75 try { 75 try {
76 tokenizer.tokenize(); 76 tokenizer.tokenize();
77 } catch (Exception e) { 77 } on Exception catch (e) {
78 thrown = e; 78 thrown = e;
79 } 79 }
80 Expect.equals("Syntax error in '$input'", thrown.toString()); 80 Expect.equals("Syntax error in '$input'", thrown.toString());
81 } 81 }
82 82
83 static void test5() { 83 static void test5() {
84 Tokenizer tokenizer = new Tokenizer( 84 Tokenizer tokenizer = new Tokenizer(
85 @"Skip , Pass if $arch == dartc, Fail || Timeout if " 85 @"Skip , Pass if $arch == dartc, Fail || Timeout if "
86 @"$arch == chromium && $mode == release"); 86 @"$arch == chromium && $mode == release");
87 tokenizer.tokenize(); 87 tokenizer.tokenize();
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 environment["arch"] = "arm"; 140 environment["arch"] = "arm";
141 Expect.isFalse(ast.evaluate(environment)); 141 Expect.isFalse(ast.evaluate(environment));
142 environment["checked"] = true; 142 environment["checked"] = true;
143 Expect.isFalse(ast.evaluate(environment)); 143 Expect.isFalse(ast.evaluate(environment));
144 } 144 }
145 } 145 }
146 146
147 main() { 147 main() {
148 StatusExpressionTest.testMain(); 148 StatusExpressionTest.testMain();
149 } 149 }
OLDNEW
« no previous file with comments | « tests/standalone/out_of_memory_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698