@@ -48,10 +48,6 @@ function runTests(callback) {
4848 }
4949 if ( debug . length < 1 ) {
5050 debug = null ;
51- } else {
52- if ( totalTests > debug . length ) {
53- totalTests = debug . length ;
54- }
5551 }
5652 }
5753 var totalTime = 0 ;
@@ -67,19 +63,15 @@ function runTests(callback) {
6763 // Remove from array for reporting incorrect tests later
6864 debug . splice ( debugIndex , 1 ) ;
6965 } else {
70- var wildcardName = test . name . split ( "_" ) . shift ( ) + "_*" ;
66+ var wildcardName = test . name . split ( "_" ) [ 0 ] + "_*" ;
7167 debugIndex = indexOf ( debug , wildcardName ) ;
7268 if ( debugIndex !== - 1 ) {
7369 // Remove from array for reporting incorrect tests later
7470 debug . splice ( debugIndex , 1 ) ;
7571 debugUsed . push ( wildcardName ) ;
7672 } else {
7773 debugIndex = indexOf ( debugUsed , wildcardName ) ;
78- if ( debugIndex !== - 1 ) {
79- totalTests ++ ;
80- } else {
81- return step ( i + 1 ) ;
82- }
74+ if ( debugIndex == - 1 ) return step ( i + 1 ) ;
8375 }
8476 }
8577 }
@@ -132,3 +124,15 @@ function eqPos(a, b, msg) {
132124function is ( a , msg ) {
133125 if ( ! a ) throw new Failure ( label ( "assertion failed" , msg ) ) ;
134126}
127+
128+ function countTests ( ) {
129+ if ( ! debug ) return tests . length ;
130+ var sum = 0 ;
131+ for ( var i = 0 ; i < tests . length ; ++ i ) {
132+ var name = tests [ i ] . name ;
133+ if ( indexOf ( debug , name ) != - 1 ||
134+ indexOf ( debug , name . split ( "_" ) [ 0 ] + "_*" ) != - 1 )
135+ ++ sum ;
136+ }
137+ return sum ;
138+ }
0 commit comments