Skip to content

Commit 0a87448

Browse files
committed
Auto-generated commit
1 parent 354c296 commit 0a87448

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,7 @@ A total of 37 issues were closed in this release:
667667

668668
<details>
669669

670+
- [`627daa6`](https://github.com/stdlib-js/stdlib/commit/627daa60f853370c88a35b910e84501704a52675) - **test:** add test cases for DataType instances _(by Athan Reines)_
670671
- [`d3a0548`](https://github.com/stdlib-js/stdlib/commit/d3a05480e872e702db968bbe9f4d3610e8aed50d) - **test:** add tests for DataType instances _(by Athan Reines)_
671672
- [`d80dfe4`](https://github.com/stdlib-js/stdlib/commit/d80dfe41a1ef87da9fdf8c4cb88c3036134faa2f) - **docs:** improve doctests for ndarray instances in `ndarray/any-by` [(#9399)](https://github.com/stdlib-js/stdlib/pull/9399) _(by Rohit R Bhat, Athan Reines)_
672673
- [`45264d0`](https://github.com/stdlib-js/stdlib/commit/45264d0387509a18856c21c332349f16c8a81086) - **docs:** improve doctests for ndarray instances in `ndarray/some` [(#9388)](https://github.com/stdlib-js/stdlib/pull/9388) _(by kaushal-kumar-it, Athan Reines)_

base/dtypes2signatures/test/test.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24+
var structFactory = require( '@stdlib/dstructs/struct' );
25+
var DataType = require( './../../../dtype-ctor' );
2426
var dtypes2signatures = require( './../lib' );
2527

2628

@@ -454,3 +456,47 @@ tape( 'the function transforms a list of array argument data types into a list o
454456
t.deepEqual( actual, expected, 'returns expected value' );
455457
t.end();
456458
});
459+
460+
tape( 'the function transforms a list of array argument data types into a list of signatures (2 in, 1 out, data type instances)', function test( t ) {
461+
var expected;
462+
var actual;
463+
var dtypes;
464+
465+
dtypes = [ new DataType( 'float64' ), new DataType( 'float64' ), new DataType( 'generic' ) ];
466+
expected = [ '(float64, float64) => (generic)' ];
467+
468+
actual = dtypes2signatures( dtypes, 2, 1 );
469+
470+
t.deepEqual( actual, expected, 'returns expected value' );
471+
t.end();
472+
});
473+
474+
tape( 'the function transforms a list of array argument data types into a list of signatures (1 in, 1 out, structs)', function test( t ) {
475+
var expected;
476+
var schemas;
477+
var actual;
478+
var dtypes;
479+
480+
schemas = [
481+
[
482+
{
483+
'name': 'foo',
484+
'type': 'float64'
485+
}
486+
],
487+
[
488+
{
489+
'name': 'foo',
490+
'type': 'float32'
491+
}
492+
]
493+
];
494+
495+
dtypes = [ structFactory( schemas[ 0 ] ), structFactory( schemas[ 1 ] ) ];
496+
expected = [ '(|<float64>[0,8]|) => (|<float32>[0,4]|)' ];
497+
498+
actual = dtypes2signatures( dtypes, 1, 1 );
499+
500+
t.deepEqual( actual, expected, 'returns expected value' );
501+
t.end();
502+
});

0 commit comments

Comments
 (0)