From 89116e95dd8900150059004caec640a01120aad6 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 3 Oct 2022 15:48:13 -0700 Subject: [PATCH] Temporal: Add some assertion messages to help with debugging --- .../total/precision-exact-mathematical-values-1.js | 8 ++++---- .../hoursInDay/precision-exact-mathematical-values.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-1.js b/test/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-1.js index e2cc0073ea..4ff389fe61 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-1.js +++ b/test/built-ins/Temporal/Duration/prototype/total/precision-exact-mathematical-values-1.js @@ -85,12 +85,12 @@ let total = duration.total({unit: "hours"}); // is 4000.0000000000005. const expected = 4000.0000000000005; -assert.sameValue(expected, 4000.0000000000002777); +assert.sameValue(expected, 4000.0000000000002777, "the float representation of the result is 4000.0000000000005"); // The next Number in direction -Infinity is less precise. -assert.sameValue(nextDown(expected), 4000); +assert.sameValue(nextDown(expected), 4000, "the next Number in direction -Infinity is less precise"); // The next Number in direction +Infinity is less precise. -assert.sameValue(nextUp(expected), 4000.000000000001); +assert.sameValue(nextUp(expected), 4000.000000000001, "the next Number in direction +Infinity is less precise"); -assert.sameValue(total, expected); +assert.sameValue(total, expected, "return value of total()"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/precision-exact-mathematical-values.js b/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/precision-exact-mathematical-values.js index 52a6970cb0..adb6380cff 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/precision-exact-mathematical-values.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/hoursInDay/precision-exact-mathematical-values.js @@ -64,7 +64,7 @@ function test(todayInstant, tomorrowInstant, expected) { let zdt = new Temporal.ZonedDateTime(0n, timeZone); let zdt_hoursInDay = zdt.hoursInDay; - assert.sameValue(zdt_hoursInDay, expected); + assert.sameValue(zdt_hoursInDay, expected, "hoursInDay return value"); // Ensure the |expected| value is actually correctly rounded.