summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/tzoffset-transition-apia.js
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2018-05-31 11:11:57 +0200
committerMyles Borins <mylesborins@google.com>2018-06-01 09:58:27 +0200
commit352a525eb984b8fa2d6f0f6fd68395e6a080bba4 (patch)
treea105ae93f8fd8f533cce19a429f1b6e95d6e11ca /deps/v8/test/mjsunit/tzoffset-transition-apia.js
parentfaf449ca0490f5371dc6cbbc94a87eb697b00fcc (diff)
downloadandroid-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.tar.gz
android-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.tar.bz2
android-node-v8-352a525eb984b8fa2d6f0f6fd68395e6a080bba4.zip
deps: update V8 to 6.7.288.43
PR-URL: https://github.com/nodejs/node/pull/19989 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matheus Marchini <matheus@sthima.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/test/mjsunit/tzoffset-transition-apia.js')
-rw-r--r--deps/v8/test/mjsunit/tzoffset-transition-apia.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/tzoffset-transition-apia.js b/deps/v8/test/mjsunit/tzoffset-transition-apia.js
new file mode 100644
index 0000000000..bd6b6f73c3
--- /dev/null
+++ b/deps/v8/test/mjsunit/tzoffset-transition-apia.js
@@ -0,0 +1,48 @@
+// Copyright 2018 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --icu-timezone-data
+// Environment Variables: TZ=Pacific/Apia
+
+// https://www.timeanddate.com/time/zone/samoa/apia
+
+// 2011-09-24T03:00 : UTC-11 => UTC-10
+assertEquals(new Date(Date.UTC(2011, 8, 24, 13, 59)),
+ new Date(2011, 8, 24, 2, 59))
+assertEquals(new Date(Date.UTC(2011, 8, 24, 14, 30)),
+ new Date(2011, 8, 24, 3, 30));
+assertEquals(new Date(Date.UTC(2011, 8, 24, 14)),
+ new Date(2011, 8, 24, 4));
+assertEquals(new Date(Date.UTC(2011, 8, 24, 14, 30)),
+ new Date(2011, 8, 24, 4, 30));
+assertEquals((new Date(2011, 8, 24, 4, 30)).getTimezoneOffset(),
+ (new Date(2011, 8, 24, 3, 30)).getTimezoneOffset());
+
+// 2011-12-30T00:00 : UTC-10 => UTC+14
+// A whole day(2011-12-30; 24 hours) is skipped, but the skipped
+// time is to be interpreted with an offset before the transition.
+assertEquals(new Date(Date.UTC(2011, 11, 30, 9, 59)),
+ new Date(2011, 11, 29, 23, 59));
+for (var h = 0; h < 24; ++h) {
+ assertEquals(new Date(Date.UTC(2011, 11, 30, h + 10)),
+ new Date(2011, 11, 30, h));
+ assertEquals(new Date(Date.UTC(2011, 11, 30, h + 10, 30)),
+ new Date(2011, 11, 30, h, 30));
+ assertEquals(new Date(Date.UTC(2011, 11, 30, h + 10)),
+ new Date(2011, 11, 31, h));
+ assertEquals(new Date(Date.UTC(2011, 11, 30, h + 10, 30)),
+ new Date(2011, 11, 31, h, 30));
+}
+assertEquals(new Date(Date.UTC(2011, 11, 31, 10)),
+ new Date(2012, 0, 1, 0));
+
+// 2012-04-01T0400: UTC+14 => UTC+13
+assertEquals(new Date(Date.UTC(2012, 2, 31, 13)),
+ new Date(2012, 3, 1, 3));
+assertEquals(new Date(Date.UTC(2012, 2, 31, 13, 30)),
+ new Date(2012, 3, 1, 3, 30));
+assertEquals(new Date(Date.UTC(2012, 2, 31, 13, 59)),
+ new Date(2012, 3, 1, 3, 59))
+assertEquals(new Date(Date.UTC(2012, 2, 31, 15)),
+ new Date(2012, 3, 1, 4))