mirror of https://github.com/tc39/test262.git
Rendering Duration with negative components
A rendered Duration that was constructed with negative componented begins with a `-`, but that's the last time a minus sign appears.
This commit is contained in:
parent
8d025ef1d6
commit
85973b35e4
|
@ -0,0 +1,11 @@
|
|||
// 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.duration.prototype.tojson
|
||||
description: Temporal.Duration.toJSON handles negative components
|
||||
features: [Temporal]
|
||||
---*/
|
||||
const d = new Temporal.Duration(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
const expected = "-P1Y1M1W1DT1H1M1.001001001S";
|
||||
assert.sameValue(d.toJSON(), expected, "toJSON with negative components");
|
|
@ -0,0 +1,11 @@
|
|||
// 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.duration.prototype.tostring
|
||||
description: Temporal.Duration.toString handles negative components
|
||||
features: [Temporal]
|
||||
---*/
|
||||
const d = new Temporal.Duration(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
|
||||
const expected = "-P1Y1M1W1DT1H1M1.001001001S";
|
||||
assert.sameValue(d.toString(), expected, "toString with negative components");
|
Loading…
Reference in New Issue