From f768a24ab655b5ae512766ad46892549f1e442cc Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 24 Jan 2022 11:28:27 +0100 Subject: [PATCH] Test singular units in PlainDate#{add,subtract}. --- .../prototype/add/argument-singular-units.js | 13 +++++++++++++ .../prototype/subtract/argument-singular-units.js | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 test/built-ins/Temporal/PlainDate/prototype/add/argument-singular-units.js create mode 100644 test/built-ins/Temporal/PlainDate/prototype/subtract/argument-singular-units.js diff --git a/test/built-ins/Temporal/PlainDate/prototype/add/argument-singular-units.js b/test/built-ins/Temporal/PlainDate/prototype/add/argument-singular-units.js new file mode 100644 index 0000000000..dff07c5857 --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/add/argument-singular-units.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.add +description: Ignores singular properties +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const date = Temporal.PlainDate.from("2019-11-18"); +TemporalHelpers.assertPlainDate(date.add({ month: 1, days: 1 }), + 2019, 11, "M11", 19); diff --git a/test/built-ins/Temporal/PlainDate/prototype/subtract/argument-singular-units.js b/test/built-ins/Temporal/PlainDate/prototype/subtract/argument-singular-units.js new file mode 100644 index 0000000000..c8d7a3818b --- /dev/null +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/argument-singular-units.js @@ -0,0 +1,13 @@ +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plaindate.prototype.subtract +description: Ignores singular properties +includes: [temporalHelpers.js] +features: [Temporal] +---*/ + +const date = Temporal.PlainDate.from("2019-11-18"); +TemporalHelpers.assertPlainDate(date.subtract({ month: 1, days: 1 }), + 2019, 11, "M11", 17);