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

math.sw is missing tests #5330

Closed
Braqzen opened this issue Dec 1, 2023 · 0 comments · Fixed by #5423
Closed

math.sw is missing tests #5330

Braqzen opened this issue Dec 1, 2023 · 0 comments · Fixed by #5423
Labels
lib: std Standard library testing General testing

Comments

@Braqzen
Copy link
Contributor

Braqzen commented Dec 1, 2023

It appears that most of the functionality in that module is untested, at least in Sway.
If it's tested in our Rust suite then it's not easily findable.

We should test the module.

@Braqzen Braqzen added lib: std Standard library testing General testing labels Dec 1, 2023
xunilrj pushed a commit that referenced this issue Jan 3, 2024
## Description
Closes #5330

Previously, there were no tests for the `sqrt()` method in `math.sw`.
This adds square root tests in the Rust test suite.
Other tests are found here:
-
[`pow()`](https://github.com/FuelLabs/sway/blob/master/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/exponentiation_test/src/main.sw)
- [`log()` and
`log2()`](https://github.com/FuelLabs/sway/blob/master/test/src/e2e_vm_tests/test_programs/should_pass/stdlib/logarithmic_test/src/main.sw)


## Checklist

- [x] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: Joshua Batty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib: std Standard library testing General testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant