mirror of https://github.com/tc39/test262.git
Add forgotten PlainDate tests
I forgot to add these to PlainDate, testing what happens when we pass undefined as the value for the largestUnit option. Similar tests already exist for the other types.
This commit is contained in:
parent
4382f17f29
commit
06ced3f812
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.since
|
||||
description: Fallback value for largestUnit option
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const earlier = new Temporal.PlainDate(2000, 5, 2);
|
||||
const later = new Temporal.PlainDate(2001, 6, 3);
|
||||
|
||||
const explicit = later.since(earlier, { largestUnit: undefined });
|
||||
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
|
||||
const implicit = later.since(earlier, {});
|
||||
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright (C) 2021 Igalia, S.L. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-temporal.plaindate.prototype.until
|
||||
description: Fallback value for largestUnit option
|
||||
includes: [temporalHelpers.js]
|
||||
features: [Temporal]
|
||||
---*/
|
||||
|
||||
const earlier = new Temporal.PlainDate(2000, 5, 2);
|
||||
const later = new Temporal.PlainDate(2001, 6, 3);
|
||||
|
||||
const explicit = earlier.until(later, { largestUnit: undefined });
|
||||
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
|
||||
const implicit = earlier.until(later, {});
|
||||
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
|
Loading…
Reference in New Issue