Improve comments and assertion messages

This commit is contained in:
Philip Chimento 2023-03-03 14:48:55 -08:00 committed by Ms2ger
parent c03a58ba35
commit dd47e4e248
2 changed files with 13 additions and 7 deletions

View File

@ -54,7 +54,8 @@ assert.throws(RangeError, () =>
oneNsDuration.round({
relativeTo: zdt,
smallestUnit: "days",
})
}),
"RangeError when days < 0 and sign = 1"
);
// NanosecondsToDays.20: days > 0 and sign = -1
@ -74,7 +75,8 @@ assert.throws(RangeError, () =>
negOneNsDuration.round({
relativeTo: zdt,
smallestUnit: "days",
})
}),
"RangeError when days > 0 and sign = -1"
);
// NanosecondsToDays.22: nanoseconds > 0 and sign = -1
@ -93,9 +95,10 @@ zdt = new Temporal.ZonedDateTime(
)
);
assert.throws(RangeError, () =>
// Using -1ns duration sets _nanoseocnds_ to -1 and _sign_ to -1
// Using -1ns duration sets _nanoseconds_ to -1 and _sign_ to -1
negOneNsDuration.round({
relativeTo: zdt,
smallestUnit: "days",
})
}),
"RangeError when nanoseconds > 0 and sign = -1"
);

View File

@ -53,7 +53,8 @@ assert.throws(RangeError, () =>
oneNsDuration.total({
relativeTo: zdt,
unit: "day",
})
}),
"RangeError when days < 0 and sign = 1"
);
// NanosecondsToDays.20: days > 0 and sign = -1
@ -72,7 +73,8 @@ assert.throws(RangeError, () =>
negOneNsDuration.total({
relativeTo: zdt,
unit: "day",
})
}),
"RangeError when days > 0 and sign = -1"
);
// NanosecondsToDays.22: nanoseconds > 0 and sign = -1
@ -94,5 +96,6 @@ assert.throws(RangeError, () =>
negOneNsDuration.total({
relativeTo: zdt,
unit: "day",
})
}),
"RangeError when nanoseconds > 0 and sign = -1"
);