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 |
10 void func2() { | 11 void func2() { |
11 func1(); | 12 func1(); |
12 } | 13 } |
| 14 |
13 void func3() { | 15 void func3() { |
14 try { | 16 try { |
15 func2(); | 17 func2(); |
16 } on Object catch(e, s) { | 18 } on Object catch (e, s) { |
17 var fullTrace = s.toString(); | 19 var fullTrace = s.toString(); |
18 Expect.isTrue(fullTrace.contains("func1")); | 20 Expect.isTrue(fullTrace.contains("func1")); |
19 Expect.isTrue(fullTrace.contains("func2")); | 21 Expect.isTrue(fullTrace.contains("func2")); |
20 Expect.isTrue(fullTrace.contains("func3")); | 22 Expect.isTrue(fullTrace.contains("func3")); |
21 Expect.isTrue(fullTrace.contains("func4")); | 23 Expect.isTrue(fullTrace.contains("func4")); |
22 Expect.isTrue(fullTrace.contains("func5")); | 24 Expect.isTrue(fullTrace.contains("func5")); |
23 Expect.isTrue(fullTrace.contains("func6")); | 25 Expect.isTrue(fullTrace.contains("func6")); |
24 Expect.isTrue(fullTrace.contains("main")); | 26 Expect.isTrue(fullTrace.contains("main")); |
25 } | 27 } |
26 } | 28 } |
| 29 |
27 int func4() { | 30 int func4() { |
28 func3(); | 31 func3(); |
29 return 1; | 32 return 1; |
30 } | 33 } |
| 34 |
31 int func5() { | 35 int func5() { |
32 func4(); | 36 func4(); |
33 return 1; | 37 return 1; |
34 } | 38 } |
| 39 |
35 int func6() { | 40 int func6() { |
36 func5(); | 41 func5(); |
37 return 1; | 42 return 1; |
38 } | 43 } |
| 44 |
39 main() { | 45 main() { |
40 var i = func6(); | 46 var i = func6(); |
41 Expect.equals(1, i); | 47 Expect.equals(1, i); |
42 } | 48 } |
OLD | NEW |