| OLD | NEW |
| 1 // (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // (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 | 4 |
| 5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
| 6 | 6 |
| 7 void func1() { | 7 void func1() { |
| 8 throw new Exception("Test full stacktrace"); | 8 throw new Exception("Test full stacktrace"); |
| 9 } | 9 } |
| 10 void func2() { | 10 void func2() { |
| 11 func1(); | 11 func1(); |
| 12 } | 12 } |
| 13 void func3() { | 13 void func3() { |
| 14 try { | 14 try { |
| 15 func2(); | 15 func2(); |
| 16 } on Object catch(e, s) { | 16 } on Object catch(e, s) { |
| 17 var fullTrace = s.toString(); | 17 var fullTrace = s.toString(); |
| 18 Expect.isTrue(fullTrace.contains("func1")); | 18 Expect.isTrue(fullTrace.contains("func1")); |
| 19 Expect.isTrue(fullTrace.contains("func2")); | 19 Expect.isTrue(fullTrace.contains("func2")); |
| 20 Expect.isTrue(fullTrace.contains("func3")); | 20 Expect.isTrue(fullTrace.contains("func3")); |
| 21 Expect.isTrue(fullTrace.contains("func4")); | 21 Expect.isTrue(fullTrace.contains("func4")); |
| 22 Expect.isTrue(fullTrace.contains("func5")); | 22 Expect.isTrue(fullTrace.contains("func5")); |
| 23 Expect.isTrue(fullTrace.contains("func6")); | 23 Expect.isTrue(fullTrace.contains("func6")); |
| 24 Expect.isTrue(fullTrace.contains("func7")); | 24 Expect.isTrue(fullTrace.contains("func7")); |
| 25 Expect.isTrue(fullTrace.contains("main")); | 25 Expect.isTrue(fullTrace.contains("main")); |
| 26 | 26 |
| 27 throw; // This is a rethrow. | 27 rethrow; // This is a rethrow. |
| 28 } | 28 } |
| 29 } | 29 } |
| 30 int func4() { | 30 int func4() { |
| 31 func3(); | 31 func3(); |
| 32 return 1; | 32 return 1; |
| 33 } | 33 } |
| 34 int func5() { | 34 int func5() { |
| 35 try { | 35 try { |
| 36 func4(); | 36 func4(); |
| 37 } on Object catch(e, s) { | 37 } on Object catch(e, s) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 return 1; | 52 return 1; |
| 53 } | 53 } |
| 54 int func7() { | 54 int func7() { |
| 55 func6(); | 55 func6(); |
| 56 return 1; | 56 return 1; |
| 57 } | 57 } |
| 58 main() { | 58 main() { |
| 59 var i = func7(); | 59 var i = func7(); |
| 60 Expect.equals(1, i); | 60 Expect.equals(1, i); |
| 61 } | 61 } |
| OLD | NEW |