Skip to content

Commit d199580

Browse files
committed
test: correcly pass options for native tests
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent a203308 commit d199580

File tree

6 files changed

+14
-31
lines changed

6 files changed

+14
-31
lines changed

lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/test/test.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323
var tape = require( 'tape' );
2424
var isnan = require( '@stdlib/math/base/assert/is-nan' );
25-
var abs = require( '@stdlib/math/base/special/abs' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var NINF = require( '@stdlib/constants/float64/ninf' );
28-
var EPS = require( '@stdlib/constants/float64/eps' );
2927
var skewness = require( './../lib' );
3028

3129

@@ -79,8 +77,6 @@ tape( 'if provided a nonpositive `s`, the function returns `NaN`', function test
7977

8078
tape( 'the function returns the skewness of a raised cosine distribution', function test( t ) {
8179
var expected;
82-
var delta;
83-
var tol;
8480
var mu;
8581
var s;
8682
var y;
@@ -92,13 +88,7 @@ tape( 'the function returns the skewness of a raised cosine distribution', funct
9288
for ( i = 0; i < mu.length; i++ ) {
9389
y = skewness( mu[i], s[i] );
9490
if ( expected[i] !== null ) {
95-
if ( y === expected[i] ) {
96-
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
97-
} else {
98-
delta = abs( y - expected[ i ] );
99-
tol = 2.0 * EPS * abs( expected[ i ] );
100-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. s: '+s[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
101-
}
91+
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
10292
}
10393
}
10494
t.end();

lib/node_modules/@stdlib/stats/base/dists/cosine/skewness/test/test.native.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var isnan = require( '@stdlib/math/base/assert/is-nan' );
26-
var abs = require( '@stdlib/math/base/special/abs' );
2726
var PINF = require( '@stdlib/constants/float64/pinf' );
2827
var NINF = require( '@stdlib/constants/float64/ninf' );
29-
var EPS = require( '@stdlib/constants/float64/eps' );
3028
var tryRequire = require( '@stdlib/utils/try-require' );
3129

3230

@@ -88,8 +86,6 @@ tape( 'if provided a nonpositive `s`, the function returns `NaN`', opts, functio
8886

8987
tape( 'the function returns the stdev of a raised cosine distribution', opts, function test( t ) {
9088
var expected;
91-
var delta;
92-
var tol;
9389
var mu;
9490
var s;
9591
var y;
@@ -101,13 +97,7 @@ tape( 'the function returns the stdev of a raised cosine distribution', opts, fu
10197
for ( i = 0; i < mu.length; i++ ) {
10298
y = stdev( mu[i], s[i] );
10399
if ( expected[i] !== null ) {
104-
if ( y === expected[i] ) {
105-
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
106-
} else {
107-
delta = abs( y - expected[ i ] );
108-
tol = 2.0 * EPS * abs( expected[ i ] );
109-
t.ok( delta <= tol, 'within tolerance. mu: '+mu[i]+'. s: '+s[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
110-
}
100+
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
111101
}
112102
}
113103
t.end();

lib/node_modules/@stdlib/stats/base/dists/frechet/variance/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ tape( 'main export is a function', opts, function test( t ) {
5151
t.end();
5252
});
5353

54-
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
54+
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
5555
var y = variance( NaN, 1.0, 0.0 );
5656
t.equal( isnan( y ), true, 'returns NaN' );
5757
y = variance( 1.0, NaN, 0.0 );

lib/node_modules/@stdlib/stats/base/dists/kumaraswamy/logpdf/test/test.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ tape( 'if provided a number less than or equal to zero for `x` and a finite `a`
9191
t.end();
9292
});
9393

94-
tape( 'if provided a nonpositive `a`, the function returns `NaN`', function test( t ) {
94+
tape( 'if provided a nonpositive `a`, the function returns `NaN`', opts, function test( t ) {
9595
var y;
9696

9797
y = logpdf( 2.0, 0.0, 2.0 );

lib/node_modules/@stdlib/stats/base/dists/normal/entropy/test/test.native.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,28 @@ var data = require( './fixtures/julia/data.json' );
3838
// VARIABLES //
3939

4040
var entropy = tryRequire( resolve( __dirname, './../lib/native.js' ) );
41+
var opts = {
42+
'skip': ( entropy instanceof Error )
43+
};
4144

4245

4346
// TESTS //
4447

45-
tape( 'main export is a function', function test( t ) {
48+
tape( 'main export is a function', opts, function test( t ) {
4649
t.ok( true, __filename );
4750
t.strictEqual( typeof entropy, 'function', 'main export is a function' );
4851
t.end();
4952
});
5053

51-
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
54+
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
5255
var y = entropy( NaN, 1.0 );
5356
t.equal( isnan( y ), true, 'returns NaN' );
5457
y = entropy( 1.0, NaN );
5558
t.equal( isnan( y ), true, 'returns NaN' );
5659
t.end();
5760
});
5861

59-
tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', function test( t ) {
62+
tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', opts, function test( t ) {
6063
var y;
6164

6265
y = entropy( 2.0, 0.0 );
@@ -83,7 +86,7 @@ tape( 'if provided a nonpositive `sigma`, the function returns `NaN`', function
8386
t.end();
8487
});
8588

86-
tape( 'the function returns the differential entropy of a normal distribution', function test( t ) {
89+
tape( 'the function returns the differential entropy of a normal distribution', opts, function test( t ) {
8790
var expected;
8891
var delta;
8992
var sigma;

lib/node_modules/@stdlib/stats/base/dists/triangular/variance/test/test.native.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ var data = require( './fixtures/julia/data.json' );
4343

4444
// TESTS //
4545

46-
tape( 'main export is a function', function test( t ) {
46+
tape( 'main export is a function', opts, function test( t ) {
4747
t.ok( true, __filename );
4848
t.strictEqual( typeof variance, 'function', 'main export is a function' );
4949
t.end();
5050
});
5151

52-
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
52+
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', opts, function test( t ) {
5353
var v = variance( NaN, 1.0, 0.5 );
5454
t.equal( isnan( v ), true, 'returns NaN' );
5555

@@ -62,7 +62,7 @@ tape( 'if provided `NaN` for any parameter, the function returns `NaN`', functio
6262
t.end();
6363
});
6464

65-
tape( 'if provided parameters not satisfying `a <= c <= b`, the function returns `NaN`', function test( t ) {
65+
tape( 'if provided parameters not satisfying `a <= c <= b`, the function returns `NaN`', opts, function test( t ) {
6666
var y;
6767

6868
y = variance( -1.0, -1.1, -1.0 );

0 commit comments

Comments
 (0)