@@ -95,64 +95,6 @@ tape( 'the function returns an iterator protocol-compliant object which iterativ
9595 t . end ( ) ;
9696} ) ;
9797
98- tape ( 'the function returns an iterator protocol-compliant object which iteratively computes a cumulative maximum value (value+done)' , function test ( t ) {
99- var expected ;
100- var actual ;
101- var values ;
102- var it ;
103- var v ;
104- var i ;
105-
106- values = [ 2.0 , 3.0 , 2.0 , 4.0 , 3.0 , 4.0 ] ;
107- expected = [ 2.0 , 3.0 , 3.0 , 4.0 , 4.0 , 4.0 ] ;
108-
109- it = itercumax ( createIterator ( values ) ) ;
110- t . equal ( it . next . length , 0 , 'has zero arity' ) ;
111-
112- actual = [ ] ;
113- for ( i = 0 ; i < values . length ; i ++ ) {
114- v = it . next ( ) ;
115- t . equal ( typeof v . value , 'number' , 'returns a number' ) ;
116- t . equal ( typeof v . done , 'boolean' , 'returns a boolean' ) ;
117- actual . push ( v . value ) ;
118- }
119- t . deepEqual ( actual , expected , 'returns expected values' ) ;
120-
121- v = it . next ( ) ;
122- t . equal ( v . value , void 0 , 'returns expected value' ) ;
123- t . equal ( v . done , true , 'returns expected value' ) ;
124-
125- t . end ( ) ;
126-
127- function createIterator ( arr ) {
128- var len ;
129- var it ;
130- var i ;
131-
132- len = arr . length ;
133- i = - 1 ;
134-
135- it = { } ;
136- it . next = next ;
137-
138- return it ;
139-
140- function next ( ) {
141- var out ;
142- i += 1 ;
143- if ( i < len ) {
144- out = { } ;
145- out . value = arr [ i ] ;
146- out . done = ( i === len - 1 ) ;
147- return out ;
148- }
149- return {
150- 'done' : true
151- } ;
152- }
153- }
154- } ) ;
155-
15698tape ( 'if an iterated value is a non-numeric value, the computed maximum value is `NaN`' , function test ( t ) {
15799 var expected ;
158100 var values ;
0 commit comments