OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
siva
2017/06/15 18:03:25
2017
rmacnak
2017/06/15 18:09:19
Done.
| |
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. | |
4 // Dart test program for testing throw statement | |
5 // VMOptions=--causal_async_stacks | |
6 | |
7 import "package:expect/expect.dart"; | |
8 | |
9 baz() async { | |
10 throw "Bad!"; | |
11 } | |
12 | |
13 bar() async { | |
14 await baz(); | |
15 } | |
16 | |
17 foo() async { | |
18 await bar(); | |
19 } | |
20 | |
21 main() async { | |
22 try { | |
23 await foo(); | |
24 } catch (e, st) { | |
25 Expect.isTrue(st.toString().contains("baz")); | |
26 Expect.isTrue(st.toString().contains("bar")); | |
27 Expect.isTrue(st.toString().contains("foo")); | |
28 Expect.isTrue(st.toString().contains("main")); | |
29 } | |
30 } | |
OLD | NEW |