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

Side by Side Diff: utils/tests/string_encoding/dunit.dart

Issue 9410001: restructure string decoding to support iterable use and include benchmarks for UTF-8 decoding. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: "stop using introduced variable _length. Improve docs. Created 8 years, 10 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
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 #library("dunit"); 6 #library("dunit");
7 7
8 typedef void Test(); 8 typedef void Test();
9 typedef TestResult SynchTest(); 9 typedef TestResult SynchTest();
10 typedef Future<TestResult> AsynchTest(); 10 typedef Future<TestResult> AsynchTest();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 class FailedTest extends _ExceptionResult implements TestResult { 80 class FailedTest extends _ExceptionResult implements TestResult {
81 FailedTest(String testDescription, var exception) : 81 FailedTest(String testDescription, var exception) :
82 super(testDescription, exception); 82 super(testDescription, exception);
83 83
84 String toString() => ">>> Test failure in ${_testDescription} " + 84 String toString() => ">>> Test failure in ${_testDescription} " +
85 "with:\n${exception}\n"; 85 "with:\n${exception}\n";
86 } 86 }
87 87
88 class TestError extends _ExceptionResult implements TestResult { 88 class TestError extends _ExceptionResult implements TestResult {
89 TestError(String testDescription, var exception) : 89 TestError(String testDescription, var exception, var this.stacktrace) :
90 super(testDescription, exception); 90 super(testDescription, exception);
91 91
92 String toString() => ">>> Test error caught in " + 92 String toString() => ">>> Test error caught in " +
93 "${_testDescription} with:\n${exception}\n"; 93 "${_testDescription} with:\n${exception}\n$stacktrace\n";
94
95 var stacktrace;
94 } 96 }
95 97
96 class TestClass { 98 class TestClass {
97 void register(String description, Function test, TestSuite suite) { 99 void register(String description, Function test, TestSuite suite) {
98 suite._registerTest(TestResult _() { 100 suite._registerTest(TestResult _() {
99 setUp(); 101 setUp();
100 try { 102 try {
101 test(); 103 test();
102 tearDown(); 104 tearDown();
103 return new PassedTest(description); 105 return new PassedTest(description);
104 } catch (ExpectException x) { 106 } catch (ExpectException x) {
105 tearDown(); 107 tearDown();
106 return new FailedTest(description, x); 108 return new FailedTest(description, x);
107 } catch (var x) { 109 } catch (var x, var stacktrace) {
108 tearDown(); 110 tearDown();
109 return new TestError(description, x); 111 return new TestError(description, x, stacktrace);
110 } 112 }
111 }); 113 });
112 } 114 }
113 115
114 abstract void registerTests(TestSuite suite); 116 abstract void registerTests(TestSuite suite);
115 void setUp() {} 117 void setUp() {}
116 void tearDown() {} 118 void tearDown() {}
117 } 119 }
OLDNEW
« no previous file with comments | « utils/tests/string_encoding/benchmark_runner.dart ('k') | utils/tests/string_encoding/unicode_core_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698