-
-
Notifications
You must be signed in to change notification settings - Fork 907
test: adding tests to acheive 100% coverage for blas/ext/base/dnansumkbn #3065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -224,6 +224,17 @@ tape( 'the function supports negative `stride` parameters', opts, function test( | |||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
tape('if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ){ | ||||||||||||||||||||||||||||||||||||||||||||
var x; | ||||||||||||||||||||||||||||||||||||||||||||
var v; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
x =new Float64Array([NaN , 1.0,2.0,3.0,4.0]); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
v =dnannsumkbn(x.length, x ,0); | ||||||||||||||||||||||||||||||||||||||||||||
t.strictEqual(v,0.0, 'returns expected Value'); | ||||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+227
to
+237
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
tape( 'if provided a `stride` parameter equal to `0`, the function returns a sum equal to the first element', opts, function test( t ) { | ||||||||||||||||||||||||||||||||||||||||||||
var expected; | ||||||||||||||||||||||||||||||||||||||||||||
var out; | ||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -63,6 +63,17 @@ tape( 'if a native implementation is available, the main export is the native im | |||||||||||||||||||||
} | ||||||||||||||||||||||
}); | ||||||||||||||||||||||
|
||||||||||||||||||||||
tape('if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ){ | ||||||||||||||||||||||
var x; | ||||||||||||||||||||||
var v; | ||||||||||||||||||||||
|
||||||||||||||||||||||
x =new Float64Array([NaN , 1.0,2.0,3.0,4.0]); | ||||||||||||||||||||||
|
||||||||||||||||||||||
v =dnannsumkbn(x.length, x ,0); | ||||||||||||||||||||||
t.strictEqual(v,0.0, 'returns expected Value'); | ||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||
}); | ||||||||||||||||||||||
|
||||||||||||||||||||||
Comment on lines
+66
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add it to the
Suggested change
|
||||||||||||||||||||||
tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { | ||||||||||||||||||||||
var dnannsumkbn; | ||||||||||||||||||||||
var main; | ||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -159,6 +159,17 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first | |||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
tape('if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ){ | ||||||||||||||||||||||||||||||||||||||||||||
var x; | ||||||||||||||||||||||||||||||||||||||||||||
var v; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
x =new Float64Array([NaN , 1.0,2.0,3.0,4.0]); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
v =dnannsumkbn(x.length, x ,0); | ||||||||||||||||||||||||||||||||||||||||||||
t.strictEqual(v,0.0, 'returns expected Value'); | ||||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+162
to
+172
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||
tape( 'the function supports a `stride` parameter', function test( t ) { | ||||||||||||||||||||||||||||||||||||||||||||
var expected; | ||||||||||||||||||||||||||||||||||||||||||||
var out; | ||||||||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -128,6 +128,17 @@ tape( 'the function calculates the sum of strided array elements (ignoring NaN v | |||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
tape('if provided a `stride` parameter equal to `0` and the first element is NaN, the function returns 0', function test( t ){ | ||||||||||||||||||||||||||||||||||||||||||||
var x; | ||||||||||||||||||||||||||||||||||||||||||||
var v; | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
x =new Float64Array([NaN , 1.0,2.0,3.0,4.0]); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
v =dnannsumkbn(x.length, x ,0); | ||||||||||||||||||||||||||||||||||||||||||||
t.strictEqual(v,0.0, 'returns expected Value'); | ||||||||||||||||||||||||||||||||||||||||||||
t.end(); | ||||||||||||||||||||||||||||||||||||||||||||
}); | ||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+131
to
+141
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I will definitely look into the changes and create a pr again after changing the title. |
||||||||||||||||||||||||||||||||||||||||||||
tape( 'if provided an `N` parameter less than or equal to `0`, the function returns `0.0`', opts, function test( t ) { | ||||||||||||||||||||||||||||||||||||||||||||
var expected; | ||||||||||||||||||||||||||||||||||||||||||||
var out; | ||||||||||||||||||||||||||||||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to adhere to the Style conventions. You can find them here: https://github.com/stdlib-js/stdlib/tree/develop/docs/style-guides