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

Overloaded math operators fail for mixed types #7

Closed
mrenvoize opened this issue Jan 5, 2021 · 1 comment
Closed

Overloaded math operators fail for mixed types #7

mrenvoize opened this issue Jan 5, 2021 · 1 comment

Comments

@mrenvoize
Copy link
Contributor

    cmp_ok($curr_3 - 0.02,    'eq', '$0.99', '- with number');  # This works
    cmp_ok(0.02 - $curr_3,    'eq', '-$0.99', '- with number'); # This fails

It would appear that we are missing tests for the reversibility of the overloaded mathematical operators and such reversals fail.

mrenvoize added a commit to mrenvoize/Data-Money that referenced this issue Jan 5, 2021
We add tests for issue manwar#7 here
mrenvoize added a commit to mrenvoize/Data-Money that referenced this issue Jan 5, 2021
Utilise the $swap parameter which is passed by overload to correct the
behaviour ofr subtract and three_way_compare.
manwar added a commit that referenced this issue Jan 5, 2021
  "Clone is either mis-documented or mis-coded"
- Applied patch to resolve issue #7 by @mrenvoize.
  "Overloaded math operators fail for mixed types"
@mrenvoize
Copy link
Contributor Author

Closing this one as we're now well-covered test wise and fixed since pull request #7 was merged :)

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

No branches or pull requests

1 participant