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 simple unit test library for running tests in a browser. | 6 * A simple unit test library for running tests in a browser. |
7 * | 7 * |
8 * Provides enhanced HTML output with collapsible group headers | 8 * Provides enhanced HTML output with collapsible group headers |
9 * and other at-a-glance information about the test results. | 9 * and other at-a-glance information about the test results. |
10 */ | 10 */ |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 groupedBy[t.currentGroup] = new List<TestCase>(); | 146 groupedBy[t.currentGroup] = new List<TestCase>(); |
147 } | 147 } |
148 | 148 |
149 groupedBy[t.currentGroup].add(t); | 149 groupedBy[t.currentGroup].add(t); |
150 } | 150 } |
151 | 151 |
152 // flatten the list again with tests ordered | 152 // flatten the list again with tests ordered |
153 List<TestCase> flattened = new List<TestCase>(); | 153 List<TestCase> flattened = new List<TestCase>(); |
154 | 154 |
155 groupedBy | 155 groupedBy |
156 .getValues() | 156 .values |
157 .forEach((tList){ | 157 .forEach((tList){ |
158 tList.sort((tcA, tcB) => tcA.id - tcB.id); | 158 tList.sort((tcA, tcB) => tcA.id - tcB.id); |
159 flattened.addAll(tList); | 159 flattened.addAll(tList); |
160 } | 160 } |
161 ); | 161 ); |
162 | 162 |
163 var nonAlphanumeric = new RegExp('[^a-z0-9A-Z]'); | 163 var nonAlphanumeric = new RegExp('[^a-z0-9A-Z]'); |
164 | 164 |
165 // output group headers and test rows | 165 // output group headers and test rows |
166 for (final test_ in flattened) { | 166 for (final test_ in flattened) { |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 .unittest-row-description | 406 .unittest-row-description |
407 { | 407 { |
408 } | 408 } |
409 | 409 |
410 '''; | 410 '''; |
411 } | 411 } |
412 | 412 |
413 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { | 413 void useHtmlEnhancedConfiguration([bool isLayoutTest = false]) { |
414 configure(new HtmlEnhancedConfiguration(isLayoutTest)); | 414 configure(new HtmlEnhancedConfiguration(isLayoutTest)); |
415 } | 415 } |
OLD | NEW |