Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Dec 29, 2024
1 parent c1ee215 commit a014f4e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/.keepalive

This file was deleted.

4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
<section class="release" id="unreleased">

## Unreleased (2024-12-23)
## Unreleased (2024-12-29)

<section class="bug-fixes">

### Bug Fixes

- [`5e2bbef`](https://github.com/stdlib-js/stdlib/commit/5e2bbef14efd5937e23047c01af0e740e6cbd4f6) - add missing boolean array support
- [`aea44c9`](https://github.com/stdlib-js/stdlib/commit/aea44c9c8699a4d748c0db70d4a60801bfc03c40) - update loop limit

</section>
Expand All @@ -22,6 +23,7 @@

<details>

- [`5e2bbef`](https://github.com/stdlib-js/stdlib/commit/5e2bbef14efd5937e23047c01af0e740e6cbd4f6) - **fix:** add missing boolean array support _(by Athan Reines)_
- [`aea44c9`](https://github.com/stdlib-js/stdlib/commit/aea44c9c8699a4d748c0db70d4a60801bfc03c40) - **fix:** update loop limit _(by Athan Reines)_

</details>
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/tostring.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ var CTORS = {
'generic': '[ {{data}} ]',
'binary': 'new Buffer( [ {{data}} ] )',
'complex64': 'new Complex64Array( [ {{data}} ] )',
'complex128': 'new Complex128Array( [ {{data}} ] )'
'complex128': 'new Complex128Array( [ {{data}} ] )',
'bool': 'new BooleanArray( [ {{data}} ] )'
};


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
},
"devDependencies": {
"@stdlib/array-bool": "^0.1.0",
"@stdlib/array-complex128": "^0.3.0",
"@stdlib/array-complex64": "^0.3.0",
"@stdlib/array-float32": "^0.2.2",
Expand Down
32 changes: 32 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var Float64Array = require( '@stdlib/array-float64' );
var Uint8Array = require( '@stdlib/array-uint8' );
var Complex64Array = require( '@stdlib/array-complex64' );
var Complex128Array = require( '@stdlib/array-complex128' );
var BooleanArray = require( '@stdlib/array-bool' );
var Complex64 = require( '@stdlib/complex-float32-ctor' );
var Complex128 = require( '@stdlib/complex-float64-ctor' );
var hasOwnProp = require( '@stdlib/assert-has-own-property' );
Expand Down Expand Up @@ -3445,6 +3446,37 @@ tape( 'an ndarray has a custom `toString()` method (complex type)', function tes
t.end();
});

tape( 'an ndarray has a custom `toString()` method (boolean type)', function test( t ) {
var expected;
var strides;
var actual;
var buffer;
var offset;
var dtype;
var order;
var shape;
var arr;

dtype = 'bool';
buffer = new BooleanArray( [ true, false, true, false ] );
shape = [ 2, 2 ];
order = 'row-major';
strides = [ 2, 1 ];
offset = 0;

arr = ndarray( dtype, buffer, shape, strides, offset, order );

t.strictEqual( hasOwnProp( arr, 'toString' ), false, 'does not have own property' );
t.strictEqual( hasProp( arr, 'toString' ), true, 'has property' );
t.strictEqual( isFunction( arr.toString ), true, 'has method' );

expected = 'ndarray( \'bool\', new BooleanArray( [ true, false, true, false ] ), [ 2, 2 ], [ 2, 1 ], 0, \'row-major\' )';
actual = arr.toString();
t.strictEqual( actual, expected, 'returns expected value' );

t.end();
});

tape( 'an ndarray has a custom `toString()` method (complex type)', function test( t ) {
var expected;
var strides;
Expand Down

0 comments on commit a014f4e

Please sign in to comment.