From c44b6e3e76e59a18bdb8db44c68373ae58c224f2 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 27 Sep 2022 17:58:36 -0700 Subject: [PATCH] Temporal: Add assertion messages to PlainTime/p/{add,subtract}/argument-object.js This made debugging these tests easier. --- .../prototype/add/argument-object.js | 26 +++++++++---------- .../prototype/subtract/argument-object.js | 26 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/built-ins/Temporal/PlainTime/prototype/add/argument-object.js b/test/built-ins/Temporal/PlainTime/prototype/add/argument-object.js index 4f0bdaa2b5..9c4117f241 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/add/argument-object.js +++ b/test/built-ins/Temporal/PlainTime/prototype/add/argument-object.js @@ -10,28 +10,28 @@ features: [Temporal] const plainTime = new Temporal.PlainTime(15, 23, 30, 123, 456, 789); TemporalHelpers.assertPlainTime(plainTime.add({ hours: 16 }), - 7, 23, 30, 123, 456, 789); + 7, 23, 30, 123, 456, 789, "add 16 hours across midnight boundary"); TemporalHelpers.assertPlainTime(plainTime.add({ minutes: 45 }), - 16, 8, 30, 123, 456, 789); + 16, 8, 30, 123, 456, 789, "add 45 minutes"); TemporalHelpers.assertPlainTime(plainTime.add({ seconds: 800 }), - 15, 36, 50, 123, 456, 789); + 15, 36, 50, 123, 456, 789, "add 800 seconds"); TemporalHelpers.assertPlainTime(plainTime.add({ milliseconds: 800 }), - 15, 23, 30, 923, 456, 789); + 15, 23, 30, 923, 456, 789, "add 800 milliseconds"); TemporalHelpers.assertPlainTime(plainTime.add({ microseconds: 800 }), - 15, 23, 30, 124, 256, 789); + 15, 23, 30, 124, 256, 789, "add 800 microseconds"); TemporalHelpers.assertPlainTime(plainTime.add({ nanoseconds: 300 }), - 15, 23, 30, 123, 457, 89); + 15, 23, 30, 123, 457, 89, "add 300 nanoseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("07:23:30.123456789").add({ hours: -16 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -16 hours across midnight boundary"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("16:08:30.123456789").add({ minutes: -45 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -45 minutes"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:36:50.123456789").add({ seconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -800 seconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:30.923456789").add({ milliseconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -800 milliseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:30.124256789").add({ microseconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -800 microseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:30.123457089").add({ nanoseconds: -300 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "add -300 nanoseconds"); TemporalHelpers.assertPlainTime(plainTime.add({ minute: 1, hours: 1 }), - 16, 23, 30, 123, 456, 789); + 16, 23, 30, 123, 456, 789, "misspelled property is ignored"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/subtract/argument-object.js b/test/built-ins/Temporal/PlainTime/prototype/subtract/argument-object.js index a981492bdf..e3b682a24c 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/subtract/argument-object.js +++ b/test/built-ins/Temporal/PlainTime/prototype/subtract/argument-object.js @@ -10,28 +10,28 @@ features: [Temporal] const plainTime = new Temporal.PlainTime(15, 23, 30, 123, 456, 789); TemporalHelpers.assertPlainTime(plainTime.subtract({ hours: 16 }), - 23, 23, 30, 123, 456, 789); + 23, 23, 30, 123, 456, 789, "subtract 16 hours across midnight boundary"); TemporalHelpers.assertPlainTime(plainTime.subtract({ minutes: 45 }), - 14, 38, 30, 123, 456, 789); + 14, 38, 30, 123, 456, 789, "subtract 45 minutes"); TemporalHelpers.assertPlainTime(plainTime.subtract({ seconds: 45 }), - 15, 22, 45, 123, 456, 789); + 15, 22, 45, 123, 456, 789, "subtract 45 seconds"); TemporalHelpers.assertPlainTime(plainTime.subtract({ milliseconds: 800 }), - 15, 23, 29, 323, 456, 789); + 15, 23, 29, 323, 456, 789, "subtract 800 milliseconds"); TemporalHelpers.assertPlainTime(plainTime.subtract({ microseconds: 800 }), - 15, 23, 30, 122, 656, 789); + 15, 23, 30, 122, 656, 789, "subtract 800 microseconds"); TemporalHelpers.assertPlainTime(plainTime.subtract({ nanoseconds: 800 }), - 15, 23, 30, 123, 455, 989); + 15, 23, 30, 123, 455, 989, "subtract 800 nanoseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("23:23:30.123456789").subtract({ hours: -16 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -16 hours across midnight boundary"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("14:38:30.123456789").subtract({ minutes: -45 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -45 minutes"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:22:45.123456789").subtract({ seconds: -45 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -45 seconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:29.323456789").subtract({ milliseconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -800 milliseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:30.122656789").subtract({ microseconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -800 microseconds"); TemporalHelpers.assertPlainTime(Temporal.PlainTime.from("15:23:30.123455989").subtract({ nanoseconds: -800 }), - 15, 23, 30, 123, 456, 789); + 15, 23, 30, 123, 456, 789, "subtract -800 nanoseconds"); TemporalHelpers.assertPlainTime(plainTime.subtract({ minute: 1, hours: 1 }), - 14, 23, 30, 123, 456, 789); + 14, 23, 30, 123, 456, 789, "misspelled property is ignored");