Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 999cdb2

Browse filesBrowse files
committed
test: remove non-number inputs from NaN test cases
--- 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 dc36e99 commit 999cdb2
Copy full SHA for 999cdb2

File tree

1 file changed

+7
-36
lines changed
Filter options
  • lib/node_modules/@stdlib/math/base/special/binomcoeff/test

1 file changed

+7
-36
lines changed

‎lib/node_modules/@stdlib/math/base/special/binomcoeff/test/test.js

Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/math/base/special/binomcoeff/test/test.js
+7-36Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -98,45 +98,16 @@ tape( 'the function evaluates the binomial coefficient for integers `n` and `k`
9898
t.end();
9999
});
100100

101-
tape( 'the function returns `NaN` if the `n` value is not an integer', function test( t ) {
102-
var values;
103-
var i;
101+
tape( 'the function returns `NaN` if provided a non-integer number for any parameter', function test( t ) {
102+
var v = binomcoeff( 3.14, 2 );
103+
t.strictEqual( isnanf( v ), true, 'returns expected value' );
104104

105-
values = [
106-
2.5,
107-
'5',
108-
null,
109-
true,
110-
void 0,
111-
[],
112-
{},
113-
function noop() {}
114-
];
115-
116-
for ( i = 0; i < values.length; i++ ) {
117-
t.strictEqual( isnanf( binomcoeff( values[i], 2 ) ), true, 'returns expected value' );
118-
}
119-
t.end();
120-
});
105+
v = binomcoeff( 2, 3.14 );
106+
t.strictEqual( isnanf( v ), true, 'returns expected value' );
121107

122-
tape( 'the function returns `NaN` if the `k` value is not an integer', function test( t ) {
123-
var values;
124-
var i;
108+
v = binomcoeff( 3.14, 3.14 );
109+
t.strictEqual( isnanf( v ), true, 'returns expected value' );
125110

126-
values = [
127-
2.5,
128-
'5',
129-
null,
130-
true,
131-
void 0,
132-
[],
133-
{},
134-
function noop() {}
135-
];
136-
137-
for ( i = 0; i < values.length; i++ ) {
138-
t.strictEqual( isnanf( binomcoeff( 2, values[i] ) ), true, 'returns expected value' );
139-
}
140111
t.end();
141112
});
142113

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.