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

Added tests for the sqrt() method in math.sw #5423

Merged
merged 5 commits into from
Jan 3, 2024

Conversation

brandonsurh
Copy link
Contributor

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:

Checklist

  • 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).
  • 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.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@brandonsurh
Copy link
Contributor Author

Will need help with adding assignees, adding labels, and requesting reviewers due to permissions. Lmk if anything else is desired with this change.

@brandonsurh brandonsurh changed the title Added tests to math.sw Added tests for the sqrt() method in math.sw Dec 28, 2023
@xunilrj
Copy link
Contributor

xunilrj commented Dec 28, 2023

Nice, but these can be unit tests inside the stdlib, right? sway-lib-std/src/math.sw has an example already.

@brandonsurh
Copy link
Contributor Author

brandonsurh commented Dec 28, 2023

Nice, but these can be unit tests inside the stdlib, right? sway-lib-std/src/math.sw has an example already.

You are correct. I would actually prefer the tests for math.sw to be right in there too, but the pre-existing ones for pow(), log(), and log2() were made elsewhere. The reason I placed them in the Rust suite was to keep things uniform, but if desired I can move all of them into math.sw.

@xunilrj
Copy link
Contributor

xunilrj commented Dec 29, 2023

but if desired I can move all of them into math.sw.

If possible I think makes more sense. Thanks! :D

@brandonsurh
Copy link
Contributor Author

If possible I think makes more sense. Thanks! :D

Moved the tests for pow(), log(), and log2() into math.sw. Everything should be good on that front! However, may need to take a look at the failing checks.

@xunilrj xunilrj merged commit 3210aef into FuelLabs:master Jan 3, 2024
33 checks passed
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.

math.sw is missing tests
3 participants