Skip to content

Commit cfecf7c

Browse files
committed
Add Buffer test
1 parent 41d2b93 commit cfecf7c

File tree

1 file changed

+11
-0
lines changed
  • lib/node_modules/@stdlib/array/dtype/test

1 file changed

+11
-0
lines changed

lib/node_modules/@stdlib/array/dtype/test/test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
var tape = require( 'tape' );
2424
var dtypes = require( '@stdlib/array/dtypes' );
2525
var ctors = require( '@stdlib/array/ctors' );
26+
var allocUnsafe = require( '@stdlib/buffer/alloc-unsafe' );
2627
var dtype = require( './../lib' );
2728

2829

@@ -64,6 +65,16 @@ tape( 'the function does not support array-like objects', function test( t ) {
6465
t.end();
6566
});
6667

68+
tape( 'the function returns `null` if provided a Node.js Buffer', function test( t ) {
69+
var buf;
70+
var dt;
71+
72+
buf = allocUnsafe( 10 );
73+
dt = dtype( buf );
74+
t.strictEqual( dt, null, 'returns expected value' );
75+
t.end();
76+
});
77+
6778
tape( 'if provided an argument having an unknown/unsupported data type, the function returns `null`', function test( t ) {
6879
var buffers;
6980
var i;

0 commit comments

Comments
 (0)