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

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

Issue 13852043: unittest: testCases back to being UnmodifiableListView (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/unittest/test/unittest_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
diff --git a/pkg/unittest/lib/unittest.dart b/pkg/unittest/lib/unittest.dart
index 50d308b8d26c0d27b8b81441d1db82c5b0f4b929..93f7d89c2e33b69f94ec99119c17f0eded4468d7 100644
--- a/pkg/unittest/lib/unittest.dart
+++ b/pkg/unittest/lib/unittest.dart
@@ -201,9 +201,10 @@ String _currentGroup = '';
/** Separator used between group names and test names. */
String groupSep = ' ';
-// TODO(nweiz): present an unmodifiable view of this once issue 8321 is fixed.
/** Tests executed in this suite. */
nweiz 2013/04/19 18:39:53 This comment should be attached to the public fiel
-final List<TestCase> testCases = new List<TestCase>();
+final List<TestCase> _testCases = new List<TestCase>();
+
+final testCases = new UnmodifiableListView<TestCase>(_testCases);
/** Setup function called before each test in a group */
Function _testSetup;
@@ -252,7 +253,7 @@ Map testState = {};
*/
void test(String spec, TestFunction body) {
ensureInitialized();
- testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
+ _testCases.add(new TestCase._internal(testCases.length + 1, _fullSpec(spec),
body));
nweiz 2013/04/19 18:39:53 Indent one more space.
}
@@ -276,7 +277,7 @@ void solo_test(String spec, TestFunction body) {
ensureInitialized();
_soloTest = new TestCase._internal(testCases.length + 1, _fullSpec(spec), body);
- testCases.add(_soloTest);
+ _testCases.add(_soloTest);
}
/** Sentinel value for [_SpreadArgsHelper]. */
@@ -690,7 +691,7 @@ void filterTests(testFilter) {
} else if (testFilter is Function) {
filterFunction = testFilter;
}
- testCases.retainWhere(filterFunction);
+ _testCases.retainWhere(filterFunction);
}
/** Runs all queued tests, one at a time. */
« no previous file with comments | « no previous file | pkg/unittest/test/unittest_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698