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 approx_eq! macro for expm1 tests. #665

Merged
merged 4 commits into from
Aug 28, 2020
Merged

Added approx_eq! macro for expm1 tests. #665

merged 4 commits into from
Aug 28, 2020

Conversation

neeldug
Copy link
Contributor

@neeldug neeldug commented Aug 26, 2020

Added approx_eq! macro for expm1 tests due to floating point arithmetic
inaccuracies, using default ULP & epsilon values. approx_eq! macro does
not work for NaN values, however, for tests this should be okay anyway!
Solves #664.

This Pull Request fixes/closes #664.

It changes the following:

  • builtins::math::tests::expm1 strict equals assertion to approx_eq assertion

Added approx_eq! macro for expm1 tests due to floating point arithmetic
inaccuracies, using default ULP & epsilon values. approx_eq! macro does
not work for NaN values, however, for tests this should be okay anyway!
Solves #664.
@codecov
Copy link

codecov bot commented Aug 26, 2020

Codecov Report

Merging #665 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #665      +/-   ##
==========================================
+ Coverage   72.69%   72.75%   +0.05%     
==========================================
  Files         179      179              
  Lines       13409    13421      +12     
==========================================
+ Hits         9748     9764      +16     
+ Misses       3661     3657       -4     
Impacted Files Coverage Δ
boa/src/builtins/math/tests.rs 100.00% <100.00%> (ø)
boa/src/builtins/object/gcobject.rs 73.87% <0.00%> (ø)
boa/src/builtins/math/mod.rs 65.76% <0.00%> (+1.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c7531af...a0b55d9. Read the comment docs.

Removed std feature as was unused in test.
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! it looks perfect. You only need to move the new dependency to the [dev-dependencies] section.

boa/Cargo.toml Outdated Show resolved Hide resolved
@Razican Razican added this to the v0.10.0 milestone Aug 27, 2020
@Razican Razican added bug Something isn't working test Issues and PRs related to the tests. labels Aug 27, 2020
Refactors tan() unit test, previously unused, to use approx_eq!() macro
for assertion to pass on CI.
@neeldug neeldug requested a review from Razican August 27, 2020 14:24
Copy link
Member

@Razican Razican left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go from my side!

@Razican Razican merged commit 2d31ea3 into boa-dev:master Aug 28, 2020
@neeldug neeldug deleted the float-cmp branch August 28, 2020 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

builtins::math::tests::expm1 MacOS Fix
3 participants