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

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

Issue 11194025: Second round of cleanups for new optional parameter semantics. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
Index: pkg/unittest/test/unittest_test.dart
===================================================================
--- pkg/unittest/test/unittest_test.dart (revision 13712)
+++ pkg/unittest/test/unittest_test.dart (working copy)
@@ -31,10 +31,10 @@
String buildStatusString(int passed, int failed, int errors,
var results,
- [int count = 0,
- String setup = '', String teardown = '',
- String uncaughtError = null,
- String message = '']) {
+ {int count: 0,
+ String setup: '', String teardown: '',
+ String uncaughtError: null,
+ String message: ''}) {
Bob Nystrom 2012/10/17 16:21:38 Check with Gram, but instead of making these named
regis 2012/10/17 19:58:16 Only 3 out of 14 calls pass a message, so I am not
var totalTests = 0;
String testDetails = '';
if (results is String) {
@@ -66,8 +66,9 @@
void onDone(int passed, int failed, int errors, List<TestCase> results,
String uncaughtError) {
- var result = buildStatusString(passed, failed, errors, results, count,
- setup, teardown, uncaughtError);
+ var result = buildStatusString(passed, failed, errors, results,
+ count: count, setup: setup, teardown: teardown,
+ uncaughtError: uncaughtError);
_port.send(result);
}
}
@@ -190,14 +191,15 @@
message: 'Expected: <5> but: was <4>.'),
buildStatusString(0, 1, 0, tests[2], message: 'Caught Exception: Fail.'),
buildStatusString(2, 0, 0, 'a a::a b b'),
- buildStatusString(1, 0, 0, 'a ${tests[4]}', 0, 'setup'),
- buildStatusString(1, 0, 0, 'a ${tests[5]}', 0, '', 'teardown'),
- buildStatusString(1, 0, 0, 'a ${tests[6]}', 0,
- 'setup', 'teardown'),
- buildStatusString(1, 0, 0, tests[7], 1),
- buildStatusString(0, 0, 1, tests[8], 1,
+ buildStatusString(1, 0, 0, 'a ${tests[4]}', count: 0, setup: 'setup'),
+ buildStatusString(1, 0, 0, 'a ${tests[5]}', count: 0, setup: '',
+ teardown: 'teardown'),
+ buildStatusString(1, 0, 0, 'a ${tests[6]}', count: 0,
+ 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).'),
- buildStatusString(1, 0, 0, tests[9], 10),
+ buildStatusString(1, 0, 0, tests[9], count: 10),
buildStatusString(0, 1, 0, tests[10], message: 'Caught error!'),
buildStatusString(1, 0, 1, 'testOne', message: 'Callback called after already being marked as done (1).:testTwo:'),
buildStatusString(2, 1, 0, 'testOne::testTwo:Expected: false but: was <true>.:testThree')

Powered by Google App Engine
This is Rietveld 408576698