Skip to content

Commit 5bee874

Browse files
committed
test: add tests to achieve full coverage
--- 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: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 4399896 commit 5bee874

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/test/test.factory.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,21 @@ tape( 'if provided a nonpositive `lambda`, the created function always returns `
142142
t.end();
143143
});
144144

145+
tape( 'if provided valid `k` and `lambda`, the function returns a function which returns `1` when provided `0` for `t`', function test( t ) {
146+
var mgf;
147+
var y;
148+
149+
mgf = factory( 1.0, 1.0 );
150+
y = mgf( 0.0 );
151+
t.strictEqual( y, 1.0, 'returns expected value' );
152+
153+
mgf = factory( 2.0, 3.0 );
154+
y = mgf( 0.0 );
155+
t.strictEqual( y, 1.0, 'returns expected value' );
156+
157+
t.end();
158+
});
159+
145160
tape( 'the created function evaluates the mgf', function test( t ) {
146161
var mgf;
147162
var i;

lib/node_modules/@stdlib/stats/base/dists/weibull/mgf/test/test.mgf.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,21 @@ tape( 'if provided a nonpositive `k`, the function returns `NaN`', function test
102102
t.end();
103103
});
104104

105+
tape( 'if provided `0` for `t` and valid `k` and `lambda`, the function returns `1`', function test( t ) {
106+
var y;
107+
108+
y = mgf( 0.0, 1.0, 1.0 );
109+
t.strictEqual( y, 1.0, 'returns expected value' );
110+
111+
y = mgf( 0.0, 2.0, 3.0 );
112+
t.strictEqual( y, 1.0, 'returns expected value' );
113+
114+
y = mgf( 0.0, 0.5, 2.5 );
115+
t.strictEqual( y, 1.0, 'returns expected value' );
116+
117+
t.end();
118+
});
119+
105120
tape( 'the function evaluates the mgf', function test( t ) {
106121
var lambda;
107122
var k;

0 commit comments

Comments
 (0)