Skip to content

Commit ebb4500

Browse files
committed
test: use exact equality check against fixtures
--- 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 b5bffa7 commit ebb4500

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

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

Lines changed: 2 additions & 14 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

@@ -77,10 +75,8 @@ tape( 'if provided a nonpositive `s`, the function returns `NaN`', function test
7775
t.end();
7876
});
7977

80-
tape( 'the function returns the skewness of a logistic distribution', function test( t ) {
78+
tape( 'the function returns the skewness of a logistic distribution (always 0)', function test( t ) {
8179
var expected;
82-
var delta;
83-
var tol;
8480
var mu;
8581
var s;
8682
var y;
@@ -91,15 +87,7 @@ tape( 'the function returns the skewness of a logistic distribution', function t
9187
s = data.s;
9288
for ( i = 0; i < mu.length; i++ ) {
9389
y = skewness( mu[i], s[i] );
94-
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-
}
102-
}
90+
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
10391
}
10492
t.end();
10593
});

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,7 @@ tape( 'the function returns the skewness of a logistic distribution (always 0)',
9393
s = data.s;
9494
for ( i = 0; i < mu.length; i++ ) {
9595
y = skewness( mu[i], s[i] );
96-
if ( expected[i] !== null ) {
97-
t.equal( y, 0.0, 'mu: '+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
98-
}
96+
t.equal( y, expected[i], 'mu:'+mu[i]+', s: '+s[i]+', y: '+y+', expected: '+expected[i] );
9997
}
10098
t.end();
10199
});

0 commit comments

Comments
 (0)