Chromium Code Reviews| 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. */ |