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

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

Issue 271653007: Indicate test will get a static warning when running the analyzer on it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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 | « no previous file | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 for testing throw statement 4 // Dart test program for testing throw statement
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class MyException { 8 class MyException {
9 const MyException(String message) : message_ = message; 9 const MyException(String message) : message_ = message;
10 final String message_; 10 final String message_;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 static int func4() { 79 static int func4() {
80 var i = 0; 80 var i = 0;
81 try { 81 try {
82 i = 10; 82 i = 10;
83 func5(); 83 func5();
84 } on MyException catch (e) { 84 } on MyException catch (e) {
85 i = 300; 85 i = 300;
86 try { 86 try {
87 // There should be no stackTrace in this normal excpetion object. 87 // There should be no stackTrace in this normal excpetion object.
88 // We should get a NoSuchMethodError. 88 // We should get a NoSuchMethodError.
89 var trace = e.stackTrace; 89 var trace = e.stackTrace; /// 01: static type warning
Brian Wilkerson 2014/05/08 17:49:58 As I understand it, this means that there will be
siva 2014/05/08 18:26:25 Removed 01. On 2014/05/08 17:49:58, Brian Wilkers
90 } on NoSuchMethodError catch (e) { 90 } on NoSuchMethodError catch (e) {
91 Expect.isNotNull(e.stackTrace, "Error needs a stackTrace on throw"); 91 Expect.isNotNull(e.stackTrace, "Error needs a stackTrace on throw");
92 } 92 }
93 } 93 }
94 return i; 94 return i;
95 } 95 }
96 static List func5() { 96 static List func5() {
97 // Throw an Exception (any random object). 97 // Throw an Exception (any random object).
98 throw new MyException("MyException in func5"); 98 throw new MyException("MyException in func5");
99 } 99 }
100 } 100 }
101 101
102 class ErrorStackTraceTest { 102 class ErrorStackTraceTest {
103 static testMain() { 103 static testMain() {
104 Expect.equals(100, Helper1.func1()); 104 Expect.equals(100, Helper1.func1());
105 Expect.equals(200, Helper2.func1()); 105 Expect.equals(200, Helper2.func1());
106 Expect.equals(300, Helper3.func1()); 106 Expect.equals(300, Helper3.func1());
107 } 107 }
108 } 108 }
109 109
110 main() { 110 main() {
111 ErrorStackTraceTest.testMain(); 111 ErrorStackTraceTest.testMain();
112 } 112 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698