-
-
Notifications
You must be signed in to change notification settings - Fork 447
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
test: add tests to @stdlib/ndarray/base/nullary
#2350
test: add tests to @stdlib/ndarray/base/nullary
#2350
Conversation
@Planeshifter @kgryte Please review, thanks. |
@kgryte @Planeshifter Ping, reminder. |
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.
@headlessNode Thanks for working on this. I made some changes. The main thing is splitting out the tests for the various dimensions into separate files for future maintenance. We do this for other packages, especially those which require extensive test suites, and so it makes sense to follow suit here.
I've only refactored up to 2D. For 3D and up, the files should be similar to test.2d.js
. One important change is that the unit tests test against the public interface, rather than the individual implementation files. By testing against the interface, we ensure that end-to-end tests work as expected and intended code paths are exercised.
To generate coverage reports, from the root project directory,
$ make test-cov TESTS_FILTER=".*/ndarray/base/nullary/.*"
$ make view-cov
To ensure relevant code paths were exercised, I also included additional tests for 2D, such as contiguity, non-contiguity, singleton dimensions, etc. I'd expect something similar to 3D+.
If you wouldn't mind continuing the test refactoring, then we can move full steam ahead and get these tests in! Thanks for your patience!
@kgryte Sure. Thanks for the guidance. |
@kgryte Hi, as I'm working through the refactoring, the expected array of dimension 7D+ is getting really large, 100s of elements. Here's the example shape, and stride for 7D
Is this Okay or should I try to reduce it somehow? |
You can use leading singleton dimensions. E.g., |
Alright, thanks. |
…b into ndarray-nullary-tests
@kgryte Please review, thanks. |
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.
LGTM. The primary missing tests needed at this point to achieve full test coverage are for blocked iteration. I've added tests for 2D blocked iteration. In order to avoid bogging this PR down further, I suggest we go ahead and merge. Any further tests can be added in follow-up PRs.
Thanks, @headlessNode, for working on this.
Toward #2229
Description
This pull request:
@stdlib/ndarray/base/nullary
Related Issues
This pull request:
@stdlib/ndarray/base/nullary
#2229Questions
No.
Other
I added some edge cases for
blockednullary2d
up toblockednullary4d
(same for related complex data types) to get 100% coverage. But I don't know if I used the most feasible methods. I'd like some insight into that, thanks.Checklist
@stdlib-js/reviewers