From f932f079b3038374e49c221b6f9b7785d15ec56e Mon Sep 17 00:00:00 2001 From: Aditi Date: Mon, 1 Aug 2022 16:40:11 +0530 Subject: [PATCH] Add test for Temporal.Duration.prototype.total --- .../Duration/prototype/total/total-value-infinity.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/built-ins/Temporal/Duration/prototype/total/total-value-infinity.js diff --git a/test/built-ins/Temporal/Duration/prototype/total/total-value-infinity.js b/test/built-ins/Temporal/Duration/prototype/total/total-value-infinity.js new file mode 100644 index 0000000000..8e025aa189 --- /dev/null +++ b/test/built-ins/Temporal/Duration/prototype/total/total-value-infinity.js @@ -0,0 +1,12 @@ +// 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.duration.prototype.total +description: Returns ±∞ when total is not representable as a Number value. +features: [Temporal] +---*/ + +const instance = new Temporal.Duration(0, 0, 0, 0, 0, 0, 0, 0, Number.MAX_VALUE, 0); + +assert.sameValue(instance.total('nanoseconds'), Infinity);