Test functions as options in PlainDate.from.

This commit is contained in:
Ms2ger 2022-01-19 16:57:28 +01:00 committed by Rick Waldron
parent b81ce78746
commit 6bf7d8207a
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,8 @@ validValues.forEach((value) => {
TemporalHelpers.assertPlainDate(explicit, 2000, 5, "M05", 2, "overflow is ignored"); TemporalHelpers.assertPlainDate(explicit, 2000, 5, "M05", 2, "overflow is ignored");
const implicit = Temporal.PlainDate.from(value, {}); const implicit = Temporal.PlainDate.from(value, {});
TemporalHelpers.assertPlainDate(implicit, 2000, 5, "M05", 2, "overflow is ignored"); TemporalHelpers.assertPlainDate(implicit, 2000, 5, "M05", 2, "overflow is ignored");
const lambda = Temporal.PlainDate.from(value, () => {});
TemporalHelpers.assertPlainDate(lambda, 2000, 5, "M05", 2, "overflow is ignored");
}); });
const propertyBag = { year: 2000, month: 13, day: 34 }; const propertyBag = { year: 2000, month: 13, day: 34 };
@ -39,3 +41,5 @@ const explicit = Temporal.PlainDate.from(propertyBag, { overflow: undefined });
TemporalHelpers.assertPlainDate(explicit, 2000, 12, "M12", 31, "default overflow is constrain"); TemporalHelpers.assertPlainDate(explicit, 2000, 12, "M12", 31, "default overflow is constrain");
const implicit = Temporal.PlainDate.from(propertyBag, {}); const implicit = Temporal.PlainDate.from(propertyBag, {});
TemporalHelpers.assertPlainDate(implicit, 2000, 12, "M12", 31, "default overflow is constrain"); TemporalHelpers.assertPlainDate(implicit, 2000, 12, "M12", 31, "default overflow is constrain");
const lambda = Temporal.PlainDate.from(propertyBag, () => {});
TemporalHelpers.assertPlainDate(lambda, 2000, 12, "M12", 31, "default overflow is constrain");