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