Skip to content

Commit d88ac90

Browse files
committed
Auto-generated commit
1 parent 8ca0be3 commit d88ac90

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<details>
2424

25+
- [`921a9fe`](https://github.com/stdlib-js/stdlib/commit/921a9fe9a5bd423dc5153e7aabf645fd05a175d8) - **test:** add boolean array tests _(by Athan Reines)_
2526
- [`f6df528`](https://github.com/stdlib-js/stdlib/commit/f6df52818f504fd55987a80f586ad55b40405d58) - **feat:** add `array/base/without` _(by Athan Reines)_
2627

2728
</details>

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@
4646
"@stdlib/strided-base-reinterpret-boolean": "^0.0.2",
4747
"@stdlib/strided-base-reinterpret-complex": "^0.1.2",
4848
"@stdlib/string-format": "^0.2.2",
49-
"@stdlib/types": "^0.3.2",
49+
"@stdlib/types": "^0.4.0",
5050
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2",
5151
"@stdlib/error-tools-fmtprodmsg": "^0.2.2"
5252
},
5353
"devDependencies": {
5454
"@stdlib/array-base-accessor": "^0.2.2",
5555
"@stdlib/array-base-ones": "^0.2.2",
5656
"@stdlib/array-base-zeros": "^0.2.2",
57+
"@stdlib/array-bool": "^0.1.0",
5758
"@stdlib/array-complex128": "^0.3.0",
5859
"@stdlib/array-float64": "^0.2.2",
5960
"@stdlib/array-int32": "^0.2.2",
@@ -63,6 +64,7 @@
6364
"@stdlib/assert-is-float64array": "^0.2.2",
6465
"@stdlib/assert-is-int32array": "^0.2.2",
6566
"@stdlib/assert-is-method": "^0.2.2",
67+
"@stdlib/assert-is-same-booleanarray": "^0.1.0",
6668
"@stdlib/assert-is-same-complex128array": "^0.2.2",
6769
"@stdlib/math-base-special-pow": "^0.3.0",
6870
"@stdlib/random-array-discrete-uniform": "^0.2.1",

test/test.assign.js

+34
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ var tape = require( 'tape' );
2424
var Int32Array = require( '@stdlib/array-int32' );
2525
var Float64Array = require( '@stdlib/array-float64' );
2626
var Complex128Array = require( '@stdlib/array-complex128' );
27+
var BooleanArray = require( '@stdlib/array-bool' );
2728
var AccessorArray = require( '@stdlib/array-base-accessor' );
2829
var isSameComplex128Array = require( '@stdlib/assert-is-same-complex128array' );
30+
var isSameBooleanArray = require( '@stdlib/assert-is-same-booleanarray' );
2931
var zeros = require( '@stdlib/array-zeros' );
3032
var without = require( './../lib/assign.js' );
3133

@@ -350,6 +352,38 @@ tape( 'the function copies elements to another array and sets an element at a sp
350352
t.end();
351353
});
352354

355+
tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (bool)', function test( t ) {
356+
var expected;
357+
var actual;
358+
var out;
359+
var x;
360+
361+
x = new BooleanArray( [ 1, 1, 1, 1 ] );
362+
363+
out = new BooleanArray( x.length-1 );
364+
expected = new BooleanArray( [ 1, 1, 1 ] );
365+
actual = without( x, 0, out, 1, 0 );
366+
367+
t.strictEqual( actual, out, 'returns expected value' );
368+
t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
369+
370+
out = new BooleanArray( (x.length-1)*2 );
371+
expected = new BooleanArray( [ 1, 0, 1, 0, 1, 0 ] );
372+
actual = without( x, 1, out, 2, 0 );
373+
374+
t.strictEqual( actual, out, 'returns expected value' );
375+
t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
376+
377+
out = new BooleanArray( (x.length-1)*2 );
378+
expected = new BooleanArray( [ 0, 1, 0, 1, 0, 1 ] );
379+
actual = without( x, 2, out, -2, out.length-1 );
380+
381+
t.strictEqual( actual, out, 'returns expected value' );
382+
t.strictEqual( isSameBooleanArray( actual, expected ), true, 'returns expected value' );
383+
384+
t.end();
385+
});
386+
353387
tape( 'the function copies elements to another array and sets an element at a specified index to a provided value (accessors)', function test( t ) {
354388
var expected;
355389
var actual;

0 commit comments

Comments
 (0)