Skip to content

Commit 7dbccbf

Browse files
committed
Auto-generated commit
1 parent 6febf98 commit 7dbccbf

File tree

3 files changed

+103
-1
lines changed

3 files changed

+103
-1
lines changed

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,41 @@
66

77
## Unreleased (2024-08-17)
88

9-
No changes reported for this release.
9+
<section class="packages">
10+
11+
### Packages
12+
13+
</section>
14+
15+
<!-- /.packages -->
16+
17+
<section class="contributors">
18+
19+
### Contributors
20+
21+
A total of 1 person contributed to this release. Thank you to this contributor:
22+
23+
- Athan Reines
24+
25+
</section>
26+
27+
<!-- /.contributors -->
28+
29+
<section class="commits">
30+
31+
### Commits
32+
33+
<details>
34+
35+
- [`6c76e49`](https://github.com/stdlib-js/stdlib/commit/6c76e49ef8864be363b016070187459ce8f3ef12) - **test:** refactor sample values _(by Athan Reines)_
36+
- [`921a9fe`](https://github.com/stdlib-js/stdlib/commit/921a9fe9a5bd423dc5153e7aabf645fd05a175d8) - **test:** add boolean array tests _(by Athan Reines)_
37+
- [`756afa3`](https://github.com/stdlib-js/stdlib/commit/756afa3daa3d10466283aacaf50d0adb1ba186fe) - **test:** add boolean array tests _(by Athan Reines)_
38+
39+
</details>
40+
41+
</section>
42+
43+
<!-- /.commits -->
1044

1145
</section>
1246

base/with/test/test.assign.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ var tape = require( 'tape' );
2424
var Int32Array = require( './../../../int32' );
2525
var Float64Array = require( './../../../float64' );
2626
var Complex128Array = require( './../../../complex128' );
27+
var BooleanArray = require( './../../../bool' );
2728
var AccessorArray = require( './../../../base/accessor' );
2829
var Complex128 = require( '@stdlib/complex/float64/ctor' );
2930
var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
31+
var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' );
3032
var zeros = require( './../../../zeros' );
3133
var arrayWith = require( './../lib/assign.js' );
3234

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

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

base/without/test/test.assign.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ var tape = require( 'tape' );
2424
var Int32Array = require( './../../../int32' );
2525
var Float64Array = require( './../../../float64' );
2626
var Complex128Array = require( './../../../complex128' );
27+
var BooleanArray = require( './../../../bool' );
2728
var AccessorArray = require( './../../../base/accessor' );
2829
var isSameComplex128Array = require( '@stdlib/assert/is-same-complex128array' );
30+
var isSameBooleanArray = require( '@stdlib/assert/is-same-booleanarray' );
2931
var zeros = require( './../../../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)