Skip to content

Commit ff6887b

Browse files
chore: update test.native.js
--- 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent 9b266f0 commit ff6887b

File tree

1 file changed

+27
-9
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/levy/quantile/test

1 file changed

+27
-9
lines changed

lib/node_modules/@stdlib/stats/base/dists/levy/quantile/test/test.native.js

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,15 @@ tape( 'the function evaluates the quantile function at `p` given positive `mu`',
111111
c = positiveMean.c;
112112
for ( i = 0; i < p.length; i++ ) {
113113
y = quantile( p[i], mu[i], c[i] );
114-
delta = abs( y - expected[ i ] );
115-
tol = 20.0 * EPS * abs( expected[ i ] );
116-
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
114+
if ( expected[i] !== null ) {
115+
if ( y === expected[i] ) {
116+
t.equal( y, expected[i], 'p: '+p[i]+', mu:'+mu[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
117+
} else {
118+
delta = abs( y - expected[ i ] );
119+
tol = 20.0 * EPS * abs( expected[ i ] );
120+
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
121+
}
122+
}
117123
}
118124
t.end();
119125
});
@@ -134,9 +140,15 @@ tape( 'the function evaluates the quantile function at `p` given negative `mu`',
134140
c = negativeMean.c;
135141
for ( i = 0; i < p.length; i++ ) {
136142
y = quantile( p[i], mu[i], c[i] );
137-
delta = abs( y - expected[ i ] );
138-
tol = 350.0 * EPS * abs( expected[ i ] );
139-
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
143+
if ( expected[i] !== null ) {
144+
if ( y === expected[i] ) {
145+
t.equal( y, expected[i], 'p: '+p[i]+', mu:'+mu[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
146+
} else {
147+
delta = abs( y - expected[ i ] );
148+
tol = 350.0 * EPS * abs( expected[ i ] );
149+
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
150+
}
151+
}
140152
}
141153
t.end();
142154
});
@@ -157,9 +169,15 @@ tape( 'the function evaluates the quantile function at `p` given large variance
157169
c = largeVariance.c;
158170
for ( i = 0; i < p.length; i++ ) {
159171
y = quantile( p[i], mu[i], c[i] );
160-
delta = abs( y - expected[ i ] );
161-
tol = 30.0 * EPS * abs( expected[ i ] );
162-
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
172+
if ( expected[i] !== null ) {
173+
if ( y === expected[i] ) {
174+
t.equal( y, expected[i], 'p: '+p[i]+', mu:'+mu[i]+', c: '+c[i]+', y: '+y+', expected: '+expected[i] );
175+
} else {
176+
delta = abs( y - expected[ i ] );
177+
tol = 30.0 * EPS * abs( expected[ i ] );
178+
t.ok( delta <= tol, 'within tolerance. p: '+p[ i ]+'. mu: '+mu[i]+'. c: '+c[i]+'. y: '+y+'. E: '+expected[ i ]+'. Δ: '+delta+'. tol: '+tol+'.' );
179+
}
180+
}
163181
}
164182
t.end();
165183
});

0 commit comments

Comments
 (0)