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

Unified Diff: pkg/unittest/test/unittest_test.dart

Issue 12217142: Unit test improvements: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« pkg/unittest/lib/src/expect.dart ('K') | « pkg/unittest/test/matchers_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/unittest_test.dart
===================================================================
--- pkg/unittest/test/unittest_test.dart (revision 18360)
+++ pkg/unittest/test/unittest_test.dart (working copy)
@@ -77,6 +77,11 @@
_port.send(_result);
}
}
+
+foo() {
+ ++_testconfig.count;
+}
+
runTest() {
port.receive((testName, sendport) {
configure(_testconfig = new TestConfiguration(sendport));
@@ -112,9 +117,9 @@
} else if (testName == 'correct callback test') {
test(testName,
() =>_defer(expectAsync0((){ ++_testconfig.count;})));
- } else if (testName == 'excess callback test') {
+ } else if (testName == 'excess callback test with callback name') {
test(testName, () {
- var _callback = expectAsync0((){ ++_testconfig.count;});
+ var _callback = expectAsync0(foo);
_defer(_callback);
_defer(_callback);
});
@@ -261,7 +266,7 @@
'teardown test',
'setup and teardown test',
'correct callback test',
- 'excess callback test',
+ 'excess callback test with callback name',
'completion test',
'async exception test',
'late exception test',
@@ -282,7 +287,7 @@
setup: 'setup', teardown: 'teardown'),
buildStatusString(1, 0, 0, tests[7], count: 1),
buildStatusString(0, 0, 1, tests[8], count: 1,
- message: 'Callback called more times than expected (2 > 1).'),
+ message: 'Callback foo called more times than expected (2 > 1).'),
buildStatusString(1, 0, 0, tests[9], count: 10),
buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
buildStatusString(1, 0, 1, 'testOne',
« pkg/unittest/lib/src/expect.dart ('K') | « pkg/unittest/test/matchers_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698