OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * A library for writing dart unit tests. | 6 * A library for writing dart unit tests. |
7 * | 7 * |
8 * To import this library, install the | 8 * To import this library, install the |
9 * [unittest package](http://pub.dartlang.org/packages/unittest) via the pub | 9 * [unittest package](http://pub.dartlang.org/packages/unittest) via the pub |
10 * package manager. See the [Getting Started](http://pub.dartlang.org/doc) | 10 * package manager. See the [Getting Started](http://pub.dartlang.org/doc) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 /** | 195 /** |
196 * Description text of the current test group. If multiple groups are nested, | 196 * Description text of the current test group. If multiple groups are nested, |
197 * this will contain all of their text concatenated. | 197 * this will contain all of their text concatenated. |
198 */ | 198 */ |
199 String _currentGroup = ''; | 199 String _currentGroup = ''; |
200 | 200 |
201 /** Separator used between group names and test names. */ | 201 /** Separator used between group names and test names. */ |
202 String groupSep = ' '; | 202 String groupSep = ' '; |
203 | 203 |
| 204 // TODO(nweiz): present an unmodifiable view of this once issue 8321 is fixed. |
204 /** Tests executed in this suite. */ | 205 /** Tests executed in this suite. */ |
205 final List<TestCase> _testCases = new List<TestCase>(); | 206 final List<TestCase> testCases = new List<TestCase>(); |
206 | |
207 /** Get the list of tests. */ | |
208 final List<TestCase> testCases = new UnmodifiableListView(_testCases); | |
209 | 207 |
210 /** Setup function called before each test in a group */ | 208 /** Setup function called before each test in a group */ |
211 Function _testSetup; | 209 Function _testSetup; |
212 | 210 |
213 /** Teardown function called after each test in a group */ | 211 /** Teardown function called after each test in a group */ |
214 Function _testTeardown; | 212 Function _testTeardown; |
215 | 213 |
216 int _currentTestCaseIndex = 0; | 214 int _currentTestCaseIndex = 0; |
217 | 215 |
218 /** [TestCase] currently being executed. */ | 216 /** [TestCase] currently being executed. */ |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 } | 855 } |
858 | 856 |
859 /** Enable a test by ID. */ | 857 /** Enable a test by ID. */ |
860 void enableTest(int testId) => _setTestEnabledState(testId, true); | 858 void enableTest(int testId) => _setTestEnabledState(testId, true); |
861 | 859 |
862 /** Disable a test by ID. */ | 860 /** Disable a test by ID. */ |
863 void disableTest(int testId) => _setTestEnabledState(testId, false); | 861 void disableTest(int testId) => _setTestEnabledState(testId, false); |
864 | 862 |
865 /** Signature for a test function. */ | 863 /** Signature for a test function. */ |
866 typedef dynamic TestFunction(); | 864 typedef dynamic TestFunction(); |
OLD | NEW |