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

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

@dmorejon

Description

@dmorejon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions