Temporal: Add assertion messages to PlainTime/p/{add,subtract}/argument-object.js

This made debugging these tests easier.
This commit is contained in:
Philip Chimento 2022-09-27 17:58:36 -07:00 committed by Ms2ger
parent eaf85892fb
commit c44b6e3e76
2 changed files with 26 additions and 26 deletions

View File

@ -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");

View File

@ -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");