tor-browser

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

argument-string-time-zone-annotation.js (1139B)


      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.plainyearmonth.compare
      7 description: Various forms of time zone annotation; critical flag has no effect
      8 features: [Temporal]
      9 ---*/
     10 
     11 const tests = [
     12  ["2019-12-15T15:23[Asia/Kolkata]", "named, with no offset"],
     13  ["2019-12-15T15:23[!Europe/Vienna]", "named, with ! and no offset"],
     14  ["2019-12-15T15:23[+00:00]", "numeric, with no offset"],
     15  ["2019-12-15T15:23[!-02:30]", "numeric, with ! and no offset"],
     16  ["2019-12-15T15:23+00:00[UTC]", "named, with offset"],
     17  ["2019-12-15T15:23+00:00[!Africa/Abidjan]", "named, with offset and !"],
     18  ["2019-12-15T15:23+00:00[+01:00]", "numeric, with offset"],
     19  ["2019-12-15T15:23+00:00[!-08:00]", "numeric, with offset and !"],
     20 ];
     21 
     22 tests.forEach(([arg, description]) => {
     23  const result = Temporal.PlainYearMonth.compare(arg, arg);
     24 
     25  assert.sameValue(
     26    result,
     27    0,
     28    `time zone annotation (${description})`
     29  );
     30 });
     31 
     32 reportCompare(0, 0);