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 print(fullTrace); |
18 Expect.isTrue(fullTrace.contains("func1")); | 19 Expect.isTrue(fullTrace.contains("func1")); |
19 Expect.isTrue(fullTrace.contains("func2")); | 20 Expect.isTrue(fullTrace.contains("func2")); |
20 Expect.isTrue(fullTrace.contains("func3")); | 21 Expect.isTrue(fullTrace.contains("func3")); |
21 Expect.isTrue(fullTrace.contains("func4")); | 22 Expect.isTrue(fullTrace.contains("func4")); |
22 Expect.isTrue(fullTrace.contains("func5")); | 23 Expect.isTrue(fullTrace.contains("func5")); |
23 Expect.isTrue(fullTrace.contains("func6")); | 24 Expect.isTrue(fullTrace.contains("func6")); |
24 Expect.isTrue(fullTrace.contains("main")); | 25 Expect.isTrue(fullTrace.contains("main")); |
25 } | 26 } |
26 } | 27 } |
27 int func4() { | 28 int func4() { |
28 func3(); | 29 func3(); |
29 return 1; | 30 return 1; |
30 } | 31 } |
31 int func5() { | 32 int func5() { |
32 func4(); | 33 func4(); |
33 return 1; | 34 return 1; |
34 } | 35 } |
35 int func6() { | 36 int func6() { |
36 func5(); | 37 func5(); |
37 return 1; | 38 return 1; |
38 } | 39 } |
39 main() { | 40 main() { |
40 var i = func6(); | 41 var i = func6(); |
41 Expect.equals(1, i); | 42 Expect.equals(1, i); |
42 } | 43 } |
OLD | NEW |