Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Duration/compare/compare-no-precision-loss.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2018 Bloomberg LP. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.duration.compare
7 description: Temporal.Duration.compare() does not lose precision when totaling everything down to nanoseconds.
8 features: [Temporal]
9 ---*/
10
11 const days200 = new Temporal.Duration(0, 0, 0, 200);
12 const days200oneNanosecond = new Temporal.Duration(0, 0, 0, 200, 0, 0, 0, 0, 0, 1);
13
14 assert.notSameValue(Temporal.Duration.compare(days200, days200oneNanosecond), 0);
15
16 reportCompare(0, 0);