@@ -35,12 +35,12 @@ tape( 'main export is a function', function test( t ) {
35
35
} ) ;
36
36
37
37
tape ( 'the function returns an accumulator function' , function test ( t ) {
38
- t . equal ( typeof incrstdev ( ) , 'function' , 'returns a function ' ) ;
38
+ t . equal ( typeof incrstdev ( ) , 'function' , 'returns expected value ' ) ;
39
39
t . end ( ) ;
40
40
} ) ;
41
41
42
42
tape ( 'the function returns an accumulator function (known mean)' , function test ( t ) {
43
- t . equal ( typeof incrstdev ( 3.0 ) , 'function' , 'returns a function ' ) ;
43
+ t . equal ( typeof incrstdev ( 3.0 ) , 'function' , 'returns expected value ' ) ;
44
44
t . end ( ) ;
45
45
} ) ;
46
46
@@ -91,11 +91,11 @@ tape( 'the accumulator function incrementally computes a corrected sample standa
91
91
92
92
acc = incrstdev ( ) ;
93
93
94
- actual = new Array ( data . length ) ;
94
+ actual = [ ] ;
95
95
for ( i = 0 ; i < data . length ; i ++ ) {
96
- actual [ i ] = acc ( data [ i ] ) ;
96
+ actual . push ( acc ( data [ i ] ) ) ;
97
97
}
98
- t . deepEqual ( actual , expected , 'returns expected incremental results ' ) ;
98
+ t . deepEqual ( actual , expected , 'returns expected value ' ) ;
99
99
t . end ( ) ;
100
100
} ) ;
101
101
@@ -120,15 +120,15 @@ tape( 'the accumulator function incrementally computes a corrected sample standa
120
120
121
121
acc = incrstdev ( 3.0 ) ;
122
122
123
- actual = new Array ( data . length ) ;
123
+ actual = [ ] ;
124
124
for ( i = 0 ; i < data . length ; i ++ ) {
125
- actual [ i ] = acc ( data [ i ] ) ;
125
+ actual . push ( acc ( data [ i ] ) ) ;
126
126
}
127
- t . deepEqual ( actual , expected , 'returns expected incremental results ' ) ;
127
+ t . deepEqual ( actual , expected , 'returns expected value ' ) ;
128
128
t . end ( ) ;
129
129
} ) ;
130
130
131
- tape ( 'if not provided an input value, the accumulator function returns the current corrected sample sample deviation' , function test ( t ) {
131
+ tape ( 'if not provided an input value, the accumulator function returns the current corrected sample deviation' , function test ( t ) {
132
132
var data ;
133
133
var acc ;
134
134
var i ;
@@ -138,11 +138,11 @@ tape( 'if not provided an input value, the accumulator function returns the curr
138
138
for ( i = 0 ; i < data . length ; i ++ ) {
139
139
acc ( data [ i ] ) ;
140
140
}
141
- t . equal ( acc ( ) , 1.0 , 'returns the current accumulated corrected sample standard deviation ' ) ;
141
+ t . equal ( acc ( ) , 1.0 , 'returns expected value ' ) ;
142
142
t . end ( ) ;
143
143
} ) ;
144
144
145
- tape ( 'if not provided an input value, the accumulator function returns the current corrected sample sample deviation (known mean)' , function test ( t ) {
145
+ tape ( 'if not provided an input value, the accumulator function returns the current corrected sample deviation (known mean)' , function test ( t ) {
146
146
var data ;
147
147
var acc ;
148
148
var i ;
@@ -152,7 +152,7 @@ tape( 'if not provided an input value, the accumulator function returns the curr
152
152
for ( i = 0 ; i < data . length ; i ++ ) {
153
153
acc ( data [ i ] ) ;
154
154
}
155
- t . equal ( acc ( ) , sqrt ( 0.6666666666666666 ) , 'returns the current accumulated corrected sample standard deviation ' ) ;
155
+ t . equal ( acc ( ) , sqrt ( 0.6666666666666666 ) , 'returns expected value ' ) ;
156
156
t . end ( ) ;
157
157
} ) ;
158
158
@@ -163,13 +163,13 @@ tape( 'the corrected sample standard deviation is `null` until at least 1 datum
163
163
acc = incrstdev ( ) ;
164
164
165
165
s = acc ( ) ;
166
- t . equal ( s , null , 'returns null ' ) ;
166
+ t . equal ( s , null , 'returns expected value ' ) ;
167
167
168
168
s = acc ( 3.0 ) ;
169
- t . notEqual ( s , null , 'does not return null ' ) ;
169
+ t . notEqual ( s , null , 'returns expected value ' ) ;
170
170
171
171
s = acc ( ) ;
172
- t . notEqual ( s , null , 'does not return null ' ) ;
172
+ t . notEqual ( s , null , 'returns expected value ' ) ;
173
173
174
174
t . end ( ) ;
175
175
} ) ;
@@ -181,13 +181,13 @@ tape( 'the corrected sample standard deviation is `null` until at least 1 datum
181
181
acc = incrstdev ( 3.0 ) ;
182
182
183
183
s = acc ( ) ;
184
- t . equal ( s , null , 'returns null ' ) ;
184
+ t . equal ( s , null , 'returns expected value ' ) ;
185
185
186
186
s = acc ( 3.0 ) ;
187
- t . notEqual ( s , null , 'does not return null ' ) ;
187
+ t . notEqual ( s , null , 'returns expected value ' ) ;
188
188
189
189
s = acc ( ) ;
190
- t . notEqual ( s , null , 'does not return null ' ) ;
190
+ t . notEqual ( s , null , 'returns expected value ' ) ;
191
191
192
192
t . end ( ) ;
193
193
} ) ;
@@ -199,16 +199,16 @@ tape( 'the corrected sample standard deviation is `0` until at least 2 datums ha
199
199
acc = incrstdev ( ) ;
200
200
201
201
s = acc ( 2.0 ) ;
202
- t . equal ( s , 0.0 , 'returns 0 ' ) ;
202
+ t . equal ( s , 0.0 , 'returns expected value ' ) ;
203
203
204
204
s = acc ( ) ;
205
- t . equal ( s , 0.0 , 'returns 0 ' ) ;
205
+ t . equal ( s , 0.0 , 'returns expected value ' ) ;
206
206
207
207
s = acc ( 3.0 ) ;
208
- t . notEqual ( s , 0.0 , 'does not return 0 ' ) ;
208
+ t . notEqual ( s , 0.0 , 'returns expected value ' ) ;
209
209
210
210
s = acc ( ) ;
211
- t . notEqual ( s , 0.0 , 'does not return 0 ' ) ;
211
+ t . notEqual ( s , 0.0 , 'returns expected value ' ) ;
212
212
213
213
t . end ( ) ;
214
214
} ) ;
0 commit comments