Skip to content
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 array view index #5

Merged
merged 2 commits into from
Mar 11, 2024
Merged

Conversation

markrogoyski
Copy link
Contributor

This adds unit tests for ArrayView indexing.

Note: No tests were added for floats. I presumed floats should not work and would throw an exception, but they work and return values. I recommend clearly defining what the behavior for floats should be and add unit tests to document this.

For reference in Python:

>>> [1, 2, 3][1.5]
<stdin>:1: SyntaxWarning: list indices must be integers or slices, not float; perhaps you missed a comma?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: list indices must be integers or slices, not float

Also, it was not clear what the distinction between KeyError and IndexError is. The unit tests assert what is currently being thrown.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 8226732251

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+3.6%) to 79.29%

Totals Coverage Status
Change from base Build 8224384536: 3.6%
Covered Lines: 134
Relevant Lines: 169

💛 - Coveralls

@Smoren Smoren merged commit 0ec1659 into Smoren:master Mar 11, 2024
7 checks passed
@Smoren
Copy link
Owner

Smoren commented Mar 11, 2024

Thank you for your PR! I merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants