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

Unified Diff: pkg/unittest/lib/src/config.dart

Issue 12340082: pkg/unittest: fixed asserts around currentTestCase (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/src/config.dart
diff --git a/pkg/unittest/lib/src/config.dart b/pkg/unittest/lib/src/config.dart
index cbedfb3d7cba3430b87fbd63de62794b089c60e0..8e07881cc50d4b4c2b5be509e6e127fbabd67a70 100644
--- a/pkg/unittest/lib/src/config.dart
+++ b/pkg/unittest/lib/src/config.dart
@@ -52,6 +52,8 @@ class Configuration {
* a test suite.
*/
void onTestStart(TestCase testCase) {
+ assert(testCase != null);
+ assert(_currentTestCase == null);
_currentTestCase = testCase;
}
@@ -60,7 +62,11 @@ class Configuration {
* a test suite.
*/
void onTestResult(TestCase testCase) {
- _currentTestCase = null;
+ assert(testCase != null);
+ if(_currentTestCase != null) {
Siggi Cherem (dart-lang) 2013/02/26 19:37:37 nit: since this is just for assertions and nothing
+ assert(_currentTestCase == testCase);
+ _currentTestCase = null;
+ }
}
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698