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 Oct 14, 2023
1 parent f37303a commit 6ea2d7e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 77 deletions.
4 changes: 3 additions & 1 deletion data/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3703,8 +3703,9 @@ ndarray.prototype.set,"ndarray.prototype.set( ...idx:integer, v:any )"
ndarray.prototype.iset,"ndarray.prototype.iset( idx:integer, v:any )"
ndarray.prototype.toString,"ndarray.prototype.toString()"
ndarray.prototype.toJSON,"ndarray.prototype.toJSON()"
ndarray2array,"ndarray2array( arr:ndarray )"
ndarray2array,"ndarray2array( x:ndarray )"
ndarrayCastingModes,"ndarrayCastingModes()"
ndarrayDataBuffer,"ndarrayDataBuffer( x:ndarray )"
ndarrayDataType,"ndarrayDataType( x:ndarray )"
ndarrayDataTypes,"ndarrayDataTypes( [kind:string] )"
ndarrayDispatch,"ndarrayDispatch( fcns:Function|ArrayLikeObject<Function>, types:ArrayLikeObject, data:ArrayLikeObject|null, nargs:integer, nin:integer, nout:integer )"
Expand All @@ -3729,6 +3730,7 @@ nditerRows,"nditerRows( x:ndarray[, options:Object] )"
nditerValues,"nditerValues( x:ndarray[, options:Object] )"
ndslice,"ndslice( x:ndarray, ...s:MultiSlice|Slice|null|undefined|integer|ArrayLike[, options:Object] )"
ndsliceAssign,"ndsliceAssign( x:ndarray, y:ndarray, ...s:MultiSlice|Slice|null|undefined|integer|ArrayLike[, options:Object] )"
ndsliceDimension,"ndsliceDimension( x:ndarray, dim:integer, slice:Slice|integer|null|undefined[, options:Object] )"
ndzeros,"ndzeros( shape:ArrayLikeObject<integer>|integer[, options:Object] )"
ndzerosLike,"ndzerosLike( x:ndarray[, options:Object] )"
nextGraphemeClusterBreak,"nextGraphemeClusterBreak( str:string[, fromIndex:integer] )"
Expand Down
2 changes: 1 addition & 1 deletion data/data.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

76 changes: 4 additions & 72 deletions test/dist/test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
* Copyright (c) 2023 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,81 +21,13 @@
// MODULES //

var tape = require( 'tape' );
var aliases = require( '@stdlib/namespace-aliases' );
var DATA = require( './../../data/data.json' );
var typedSignature = require( './../../dist' );
var main = require( './../../dist' );


// TESTS //

tape( 'main export is a function', function test( t ) {
tape( 'main export is defined', function test( t ) {
t.ok( true, __filename );
t.strictEqual( typeof typedSignature, 'function', 'main export is a function' );
t.end();
});

tape( 'the function throws an error if not provided a string', function test( t ) {
var values;
var i;

values = [
5,
NaN,
true,
false,
null,
void 0,
[],
{},
function noop() {}
];
for ( i = 0; i < values.length; i++ ) {
t.throws( badValue( values[i] ), TypeError, 'throws an error when provided '+values[i] );
}
t.end();

function badValue( value ) {
return function badValue() {
typedSignature( value );
};
}
});

tape( 'the function returns one or more typed signatures', function test( t ) {
var expected;
var actual;
var list;
var i;
var j;

list = aliases();
for ( i = 0; i < list.length; i++ ) {
expected = [];
for ( j = 0; j < DATA.length; j++ ) {
if ( DATA[ j ][ 0 ] === list[ i ] ) {
expected.push( DATA[ j ][ 1 ] );
}
}
if ( expected.length === 0 ) {
expected = null;
}
actual = typedSignature( list[i] );
t.deepEqual( actual, expected, 'returns expected value for '+list[i] );
}
t.end();
});

tape( 'the function returns `null` if provided an unrecognized alias', function test( t ) {
var values;
var i;

values = [
'adfkaljdfdsafs',
'adklfadjflajdslfjalsdf',
'adflkajdlkfjasdlkfjsadlkfjlasdjflsdjfla'
];
for ( i = 0; i < values.length; i++ ) {
t.strictEqual( typedSignature( values[ i ] ), null, 'returns expected value' );
}
t.strictEqual( main !== void 0, true, 'main export is defined' );
t.end();
});

0 comments on commit 6ea2d7e

Please sign in to comment.