Commit bb7fc73d authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[mjsunit] Fix error message for assertEqualsDelta

Before:
Failure: expected <true> found <false>

After:
Failure: expected <0.4 +- 0.001> found <0.3>

R=ahaas@chromium.org

Change-Id: I304fd90112cb7131103863813e7b0920be2b5c04
Reviewed-on: https://chromium-review.googlesource.com/456284Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43950}
parent 221dec32
......@@ -333,7 +333,9 @@ var failWithMessage;
assertEqualsDelta =
function assertEqualsDelta(expected, found, delta, name_opt) {
assertTrue(Math.abs(expected - found) <= delta, name_opt);
if (Math.abs(expected - found) > delta) {
fail(PrettyPrint(expected) + " +- " + PrettyPrint(delta), found, name_opt);
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment