Skip to content

Commit 982c328

Browse files
committed
Update test values
1 parent b44ccf5 commit 982c328

File tree

1 file changed

+43
-7
lines changed
  • lib/node_modules/@stdlib/stats/incr/mmax/test

1 file changed

+43
-7
lines changed

lib/node_modules/@stdlib/stats/incr/mmax/test/test.js

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,42 @@ tape( 'the accumulator function correctly handles signed zeros', function test(
123123

124124
acc = incrmmax( 3 );
125125

126-
data = [ -0.0, 0.0, -0.0, -0.0, -0.0, 0.0, -0.0, -0.0, -0.0, 0.0 ];
127-
expected = [ -0.0, 0.0, 0.0, 0.0, -0.0, 0.0, 0.0, 0.0, -0.0, 0.0 ];
126+
data = [
127+
-0.0, // -0
128+
0.0, // -0, 0
129+
-0.0, // -0, 0, -0
130+
-0.0, // 0, -0, -0
131+
-0.0, // -0, -0, -0
132+
0.0, // -0, -0, 0
133+
-0.0, // -0, 0, -0
134+
-0.0, // 0, -0, -0
135+
-0.0, // -0, -0, -0
136+
0.0, // -0, -0, 0
137+
0.0, // -0, 0, 0
138+
0.0, // 0, 0, 0
139+
-0.0 // 0, 0, -0
140+
];
141+
expected = [
142+
-0.0,
143+
0.0,
144+
0.0,
145+
0.0,
146+
-0.0,
147+
0.0,
148+
0.0,
149+
0.0,
150+
-0.0,
151+
0.0,
152+
0.0,
153+
0.0,
154+
0.0
155+
];
128156
for ( i = 0; i < data.length; i++ ) {
129157
v = acc( data[ i ] );
130158
if ( isPositiveZero( expected[ i ] ) ) {
131-
t.equal( isPositiveZero( v ), true, 'returns expected value' );
159+
t.equal( isPositiveZero( v ), true, 'returns expected value for window '+i );
132160
} else {
133-
t.equal( isNegativeZero( v ), true, 'returns expected value' );
161+
t.equal( isNegativeZero( v ), true, 'returns expected value for window '+i );
134162
}
135163
}
136164
t.end();
@@ -160,7 +188,11 @@ tape( 'if provided `NaN`, the accumulated value is `NaN` for at least `W` invoca
160188
NaN, // 3.14, 3.14, NaN
161189
3.14, // 3.14, NaN, 3.14
162190
3.14, // NaN, 3.14, 3.14
163-
NaN // 3.14, NaN, 3.14
191+
NaN, // 3.14, 3.14, NaN
192+
NaN, // 3.14, NaN, NaN
193+
NaN, // NaN, NaN, NaN
194+
NaN, // NaN, NaN, NaN
195+
3.14 // NaN, NaN, 3.14
164196
];
165197
expected = [
166198
NaN,
@@ -177,14 +209,18 @@ tape( 'if provided `NaN`, the accumulated value is `NaN` for at least `W` invoca
177209
NaN,
178210
NaN,
179211
NaN,
212+
NaN,
213+
NaN,
214+
NaN,
215+
NaN,
180216
NaN
181217
];
182218
for ( i = 0; i < data.length; i++ ) {
183219
v = acc( data[ i ] );
184220
if ( isnan( expected[ i ] ) ) {
185-
t.equal( isnan( v ), true, 'returns expected value' );
221+
t.equal( isnan( v ), true, 'returns expected value for window '+i );
186222
} else {
187-
t.equal( v, expected[ i ], 'returns expected value' );
223+
t.equal( v, expected[ i ], 'returns expected value for window '+i );
188224
}
189225
}
190226
t.end();

0 commit comments

Comments
 (0)