Skip to content

Commit 67ffef5

Browse files
headlessNodekgryte
authored andcommitted
test: add tests to ndarray/base/count-falsy
PR-URL: stdlib-js#8305 Closes: stdlib-js/metr-issue-tracker#103 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 8063ac4 commit 67ffef5

File tree

14 files changed

+18597
-3
lines changed

14 files changed

+18597
-3
lines changed

lib/node_modules/@stdlib/ndarray/base/count-falsy/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ function countFalsy( arrays ) {
274274
}
275275
// Check whether we were provided an empty ndarray...
276276
if ( len === 0 ) {
277-
return true;
277+
return 0;
278278
}
279279
// Determine whether the ndarray is one-dimensional and thus readily translates to a one-dimensional strided array...
280280
if ( ndims === 1 ) {

lib/node_modules/@stdlib/ndarray/base/count-falsy/test/test.0d.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ tape( 'the function counts the number of falsy elements in a 0-dimensional ndarr
6262
var actual;
6363
var x;
6464

65-
x = ndarray( 'float64', toAccessorArray( new Float64Array( [ 0.0 ] ) ), [], [ 0 ], 0, 'row-major' );
65+
x = ndarray( 'generic', toAccessorArray( new Float64Array( [ 0.0 ] ) ), [], [ 0 ], 0, 'row-major' );
6666

6767
actual = countFalsy( [ x ] );
6868
t.strictEqual( actual, 1, 'returns expected value' );
6969

70-
x = ndarray( 'float64', toAccessorArray( new Float64Array( [ 1.0 ] ) ), [], [ 0 ], 0, 'row-major' );
70+
x = ndarray( 'generic', toAccessorArray( new Float64Array( [ 1.0 ] ) ), [], [ 0 ], 0, 'row-major' );
7171

7272
actual = countFalsy( [ x ] );
7373
t.strictEqual( actual, 0, 'returns expected value' );

0 commit comments

Comments
 (0)