tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

basic.js (804B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2022 Igalia, S.L. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-temporal.plaintime.compare
      7 description: Basic tests for compare()
      8 features: [Temporal]
      9 ---*/
     10 
     11 const t1 = Temporal.PlainTime.from("08:44:15.321");
     12 const t1bis = Temporal.PlainTime.from("08:44:15.321");
     13 const t2 = Temporal.PlainTime.from("14:23:30.123");
     14 
     15 assert.sameValue(Temporal.PlainTime.compare(t1, t1), 0, "same object");
     16 assert.sameValue(Temporal.PlainTime.compare(t1, t1bis), 0, "different object");
     17 assert.sameValue(Temporal.PlainTime.compare(t1, t2), -1, "before");
     18 assert.sameValue(Temporal.PlainTime.compare(t2, t1), 1, "after");
     19 
     20 reportCompare(0, 0);