Skip to content

Commit 5e6e74e

Browse files
authored
test: update tests
Signed-off-by: Athan <kgryte@gmail.com>
1 parent 2a14c70 commit 5e6e74e

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

  • lib/node_modules/@stdlib/stats/strided/nancount/test

lib/node_modules/@stdlib/stats/strided/nancount/test/test.main.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `N` i
154154
t.end();
155155
});
156156

157+
tape( 'if provided a `stride` parameter equal to `0`, the function returns `N` if first element is valid (accessors)', function test( t ) {
158+
var x;
159+
var v;
160+
161+
x = [ 1.0, -2.0, -4.0, 5.0, 3.0 ];
162+
163+
v = nancount( x.length, toAccessorArray( x ), 0 );
164+
t.strictEqual( v, x.length, 'returns expected value' );
165+
166+
t.end();
167+
});
168+
157169
tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` if first element is NaN', function test( t ) {
158170
var x;
159171
var v;
@@ -166,6 +178,18 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` i
166178
t.end();
167179
});
168180

181+
tape( 'if provided a `stride` parameter equal to `0`, the function returns `0` if first element is NaN (accessors)', function test( t ) {
182+
var x;
183+
var v;
184+
185+
x = [ NaN, -2.0, -4.0, 5.0, 3.0 ];
186+
187+
v = nancount( x.length, toAccessorArray( x ), 0 );
188+
t.strictEqual( v, 0, 'returns expected value' );
189+
190+
t.end();
191+
});
192+
169193
tape( 'the function supports view offsets', function test( t ) {
170194
var x0;
171195
var x1;

0 commit comments

Comments
 (0)