tor-browser

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

argument-string-time-separators.js (725B)


      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.instant.from
      7 description: Time separator in string argument can vary
      8 features: [Temporal]
      9 ---*/
     10 
     11 const tests = [
     12  ["1970-01-01T00:00Z", "uppercase T"],
     13  ["1970-01-01t00:00Z", "lowercase T"],
     14  ["1970-01-01 00:00Z", "space between date and time"],
     15 ];
     16 
     17 tests.forEach(([arg, description]) => {
     18  const result = Temporal.Instant.from(arg);
     19 
     20  assert.sameValue(
     21    result.epochNanoseconds,
     22    0n,
     23    `variant time separators (${description})`
     24  );
     25 });
     26 
     27 reportCompare(0, 0);