Skip to content

Commit 836aaf4

Browse files
committed
test: add test case for zero-dimensional ndarray-like object
1 parent 8874562 commit 836aaf4

File tree

1 file changed

+8
-0
lines changed
  • lib/node_modules/@stdlib/ndarray/base/strides/test

1 file changed

+8
-0
lines changed

lib/node_modules/@stdlib/ndarray/base/strides/test/test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ tape( 'if provided a zero-dimensional ndarray, the function returns a single-ele
3838
t.end();
3939
});
4040

41+
tape( 'if provided a zero-dimensional minimal ndarray-like object, the function returns a single-element strides array', function test( t ) {
42+
var x = {
43+
'shape': []
44+
};
45+
t.deepEqual( strides( x, false ), [ 0 ], 'returns expected value' );
46+
t.end();
47+
});
48+
4149
tape( 'the function returns the strides of an ndarray', function test( t ) {
4250
var expected;
4351
var values;

0 commit comments

Comments
 (0)