| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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, specify the relative path to | 8 * To import this library, specify the relative path to |
| 9 * pkg/unittest/unittest.dart. | 9 * pkg/unittest/unittest.dart. |
| 10 * | 10 * |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 _config.onDone(testsPassed_, testsFailed_, testsErrors_, _tests, | 809 _config.onDone(testsPassed_, testsFailed_, testsErrors_, _tests, |
| 810 _uncaughtErrorMessage); | 810 _uncaughtErrorMessage); |
| 811 _initialized = false; | 811 _initialized = false; |
| 812 } | 812 } |
| 813 | 813 |
| 814 String _fullSpec(String spec) { | 814 String _fullSpec(String spec) { |
| 815 if (spec === null) return '$_currentGroup'; | 815 if (spec === null) return '$_currentGroup'; |
| 816 return _currentGroup != '' ? '$_currentGroup$groupSep$spec' : spec; | 816 return _currentGroup != '' ? '$_currentGroup$groupSep$spec' : spec; |
| 817 } | 817 } |
| 818 | 818 |
| 819 void _fail(String message) { | 819 void fail(String message) { |
| 820 throw new ExpectException(message); | 820 throw new ExpectException(message); |
| 821 } | 821 } |
| 822 | 822 |
| 823 /** | 823 /** |
| 824 * Lazily initializes the test library if not already initialized. | 824 * Lazily initializes the test library if not already initialized. |
| 825 */ | 825 */ |
| 826 ensureInitialized() { | 826 ensureInitialized() { |
| 827 if (_initialized) { | 827 if (_initialized) { |
| 828 return; | 828 return; |
| 829 } | 829 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 } | 871 } |
| 872 | 872 |
| 873 /** Enable a test by ID. */ | 873 /** Enable a test by ID. */ |
| 874 void enableTest(int testId) => _setTestEnabledState(testId, true); | 874 void enableTest(int testId) => _setTestEnabledState(testId, true); |
| 875 | 875 |
| 876 /** Disable a test by ID. */ | 876 /** Disable a test by ID. */ |
| 877 void disableTest(int testId) => _setTestEnabledState(testId, false); | 877 void disableTest(int testId) => _setTestEnabledState(testId, false); |
| 878 | 878 |
| 879 /** Signature for a test function. */ | 879 /** Signature for a test function. */ |
| 880 typedef void TestFunction(); | 880 typedef void TestFunction(); |
| OLD | NEW |