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 (2435B)


      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: Various forms of time zone annotation; critical flag has no effect
      8 features: [Temporal]
      9 ---*/
     10 
     11 const tests = [
     12  ["12:34:56.987654321[Asia/Kolkata]", "named, with no offset"],
     13  ["12:34:56.987654321[!Europe/Vienna]", "named, with ! and no offset"],
     14  ["12:34:56.987654321[+00:00]", "numeric, with no offset"],
     15  ["12:34:56.987654321[!-02:30]", "numeric, with ! and no offset"],
     16  ["T12:34:56.987654321[UTC]", "named, with T and no offset"],
     17  ["T12:34:56.987654321[!Africa/Abidjan]", "named, with T, !, and no offset"],
     18  ["T12:34:56.987654321[+01:00]", "numeric, with T and no offset"],
     19  ["T12:34:56.987654321[!-08:00]", "numeric, with T, !, and no offset"],
     20  ["12:34:56.987654321+00:00[America/Sao_Paulo]", "named, with offset"],
     21  ["12:34:56.987654321+00:00[!Asia/Tokyo]", "named, with ! and offset"],
     22  ["12:34:56.987654321+00:00[-02:30]", "numeric, with offset"],
     23  ["12:34:56.987654321+00:00[!+00:00]", "numeric, with ! and offset"],
     24  ["T12:34:56.987654321+00:00[America/New_York]", "named, with T and offset"],
     25  ["T12:34:56.987654321+00:00[!UTC]", "named, with T, !, and offset"],
     26  ["T12:34:56.987654321+00:00[-08:00]", "numeric, with T and offset"],
     27  ["T12:34:56.987654321+00:00[!+01:00]", "numeric, with T, !, and offset"],
     28  ["1970-01-01T12:34:56.987654321[Africa/Lagos]", "named, with date and no offset"],
     29  ["1970-01-01T12:34:56.987654321[!America/Vancouver]", "named, with date, !, and no offset"],
     30  ["1970-01-01T12:34:56.987654321[+00:00]", "numeric, with date and no offset"],
     31  ["1970-01-01T12:34:56.987654321[!-02:30]", "numeric, with date, !, and no offset"],
     32  ["1970-01-01T12:34:56.987654321+00:00[Europe/London]", "named, with date and offset"],
     33  ["1970-01-01T12:34:56.987654321+00:00[!Asia/Seoul]", "named, with date, offset, and !"],
     34  ["1970-01-01T12:34:56.987654321+00:00[+01:00]", "numeric, with date and offset"],
     35  ["1970-01-01T12:34:56.987654321+00:00[!-08:00]", "numeric, with date, offset, and !"],
     36 ];
     37 
     38 tests.forEach(([arg, description]) => {
     39  const result = Temporal.PlainTime.compare(arg, arg);
     40 
     41  assert.sameValue(
     42    result,
     43    0,
     44    `time zone annotation (${description})`
     45  );
     46 });
     47 
     48 reportCompare(0, 0);