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

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

Issue 1088433004: Add StackTrace.fromString constructor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 5 years, 8 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 | « tests/corelib/stacktrace_fromstring_test.dart ('k') | 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 import "dart:async"; 1 import "dart:async";
2 import "package:expect/expect.dart"; 2 import "package:expect/expect.dart";
3 3
4 class Blah extends StackTrace { 4 class Blah implements StackTrace {
5 Blah(this._trace); 5 Blah(this._trace);
6 6
7 toString() { 7 toString() {
8 return "Blah " + _trace.toString(); 8 return "Blah " + _trace.toString();
9 } 9 }
10 10
11 var _trace; 11 var _trace;
12 } 12 }
13 13
14 foo() { 14 foo() {
15 var x = "\nBloop\nBleep\n"; 15 var x = "\nBloop\nBleep\n";
16 return new Future.error(42, new Blah(x)); 16 return new Future.error(42, new Blah(x));
17 } 17 }
18 18
19 main() async { 19 main() async {
20 try { 20 try {
21 var x = await foo(); 21 var x = await foo();
22 Expect.fail("Should not reach here."); 22 Expect.fail("Should not reach here.");
23 } on int catch (e, s) { 23 } on int catch (e, s) {
24 Expect.equals(42, e); 24 Expect.equals(42, e);
25 Expect.equals("Blah \nBloop\nBleep\n", s.toString()); 25 Expect.equals("Blah \nBloop\nBleep\n", s.toString());
26 return; 26 return;
27 } 27 }
28 Expect.fail("Unreachable."); 28 Expect.fail("Unreachable.");
29 } 29 }
OLDNEW
« no previous file with comments | « tests/corelib/stacktrace_fromstring_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698