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

Side by Side Diff: tests/language_strong/local_function3_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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
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 // Dart test program testing closures. 4 // Dart test program testing closures.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class LocalFunction3Test { 8 class LocalFunction3Test {
9 static testExceptions() { 9 static testExceptions() {
10 var f = (int n) { return n + 1; }; 10 var f = (int n) {
11 return n + 1;
12 };
11 Expect.equals(true, f is Object); 13 Expect.equals(true, f is Object);
12 bool exception_caught = false; 14 bool exception_caught = false;
13 try { 15 try {
14 f.xyz(0); 16 f.xyz(0);
15 } on NoSuchMethodError catch (e) { 17 } on NoSuchMethodError catch (e) {
16 exception_caught = true; 18 exception_caught = true;
17 } 19 }
18 Expect.equals(true, exception_caught); 20 Expect.equals(true, exception_caught);
19 exception_caught = false; 21 exception_caught = false;
20 String f_string; 22 String f_string;
21 try { 23 try {
22 f_string = f.toString(); 24 f_string = f.toString();
23 } on NoSuchMethodError catch (e) { 25 } on NoSuchMethodError catch (e) {
24 exception_caught = true; 26 exception_caught = true;
25 } 27 }
26 Expect.equals(false, exception_caught); 28 Expect.equals(false, exception_caught);
27 Expect.equals(true, f_string.startsWith("Closure")); 29 Expect.equals(true, f_string.startsWith("Closure"));
28 } 30 }
29 31
30 static testMain() { 32 static testMain() {
31 testExceptions(); 33 testExceptions();
32 } 34 }
33 } 35 }
34 36
35 main() { 37 main() {
36 LocalFunction3Test.testMain(); 38 LocalFunction3Test.testMain();
37 } 39 }
38
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698