Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

shouldBe() transformation does not work if opt_tolerance specified #16

Open
dmorejon opened this issue Aug 19, 2020 · 0 comments
Open

Comments

@dmorejon
Copy link
Contributor

dmorejon commented Aug 19, 2020

Although shouldBe() is usually called as: shouldBe("actual", "expected");, the function supports an optional
tolerance value, such as: 'shouldBe("actual", "expected", tolerance);, then our transformation to assert_equals(actual, expected);` would be incorrect.

This is should be relatively easy to fix, but is a more general issue of dealing with optional parameters in js-test.js functions. We need to remove these parameters before transforming to testharness.js functions, since we usually update the arguments array in place (meaning the third parameter would still be present if the testharness.js function only has 2).

These mistakes would fail verification, so would hopefully be caught by the person running the tool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant