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

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

Issue 158733003: Fix language tests wrt. warnings. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix tests and status. Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // Dart test for a closure result type test that cannot be eliminated at compile 5 // Dart test for a closure result type test that cannot be eliminated at compile
5 // time. 6 // time.
6 7
7 library closure_type_test; 8 library closure_type_test;
8 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
9 import 'dart:math' as math; 10 import 'dart:math' as math;
10 11
11 class Math { 12 class Math {
12 static int sqrt(x) => math.sqrt(x); 13 static
14 int /// 01: static type warning
15 sqrt(x) => math.sqrt(x);
13 } 16 }
14 17
15 isCheckedMode() { 18 isCheckedMode() {
16 try { 19 try {
17 var i = 1; 20 var i = 1;
18 String s = i; 21 String s = i;
19 return false; 22 return false;
20 } catch (e) { 23 } catch (e) {
21 return true; 24 return true;
22 } 25 }
(...skipping 14 matching lines...) Expand all
37 } on TypeError catch (error) { 40 } on TypeError catch (error) {
38 got_type_error = true; 41 got_type_error = true;
39 } 42 }
40 // Type error expected in checked mode only. 43 // Type error expected in checked mode only.
41 Expect.isTrue(got_type_error == isCheckedMode()); 44 Expect.isTrue(got_type_error == isCheckedMode());
42 } 45 }
43 46
44 root(x) => Math.sqrt(x); 47 root(x) => Math.sqrt(x);
45 48
46 main() => test(root, 4); 49 main() => test(root, 4);
OLDNEW
« no previous file with comments | « tests/language/class_literal_test.dart ('k') | tests/language/compile_time_constant_k_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698