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

[stdlib] Improve tests for abs, divmod, round free functions #2679

Closed
laszlokindrat opened this issue May 16, 2024 · 5 comments
Closed

[stdlib] Improve tests for abs, divmod, round free functions #2679

laszlokindrat opened this issue May 16, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers mojo-repo Tag all issues with this label

Comments

@laszlokindrat
Copy link
Contributor

These delegate to dunder methods, which should be tested separately for each structs that implement them. However, we do need a few basic tests to ensure that the free functions do work (e.g. so we don't accidentally rename them).

See comment: 65f0e5b#diff-2812447c50533870693b58783ccb2c24de6d8d3083372eb17084dbe369eb87a6R43-R45

@laszlokindrat laszlokindrat added good first issue Good for newcomers mojo-repo Tag all issues with this label labels May 16, 2024
@msaelices
Copy link

@laszlokindrat can I work on this?

@laszlokindrat
Copy link
Contributor Author

@msaelices it's yours, thank you!

@msaelices
Copy link

PR ready for review: #2724

modularbot pushed a commit that referenced this issue May 22, 2024
…h functions (#40350)

[External] [stdlib][NFC] Tests for the abs() round() and divmod() math
functions

All of these functions call to the specific `__abs__`, `__round__` and
`__divmod__` methods depending on the types involved.

These are some smoke tests to make sure they do not accidentally break

See ticket #2679

Co-authored-by: Manuel Saelices <msaelices@gmail.com>
Closes #2724
MODULAR_ORIG_COMMIT_REV_ID: 476d782383800dc7a6e39aaa8f0fca4c1a713844
@msaelices
Copy link

Should we close this?

@laszlokindrat
Copy link
Contributor Author

Yes, thanks for fixing it!

martinvuyk pushed a commit to martinvuyk/mojo that referenced this issue May 24, 2024
…h functions (#40350)

[External] [stdlib][NFC] Tests for the abs() round() and divmod() math
functions

All of these functions call to the specific `__abs__`, `__round__` and
`__divmod__` methods depending on the types involved.

These are some smoke tests to make sure they do not accidentally break

See ticket modularml#2679

Co-authored-by: Manuel Saelices <msaelices@gmail.com>
Closes modularml#2724
MODULAR_ORIG_COMMIT_REV_ID: 476d782383800dc7a6e39aaa8f0fca4c1a713844
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

2 participants