v8/test/intl/regress-10528.js
Frank Tang f6d2255a03 Reland "Add regression tests for 4 calendar bugs"
This is a reland of 915f729afb

Original change's description:
> Add regression tests for 4 calendar bugs
>
> These bugs was fixed by ICU68
>
> Bug: v8:10526, v8:10527, v8:10528, v8:10529
> Change-Id: I8d0dcb52d849f742e0a29314ac8a148370f60a1a
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2527086
> Reviewed-by: Shu-yu Guo <syg@chromium.org>
> Commit-Queue: Frank Tang <ftang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#71062}

Cq-Include-Trybots: luci.v8.try:v8_android_arm64_n5x_rel_ng
Bug: v8:10526
Bug: v8:10527
Bug: v8:10528
Bug: v8:10529
Change-Id: I8857fb8c104bb4bede8fe816574bfd46ccbcd082
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2536737
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#71244}
2020-11-17 23:47:08 +00:00

21 lines
982 B
JavaScript

// Copyright 2020 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.
// Test date format in Hebrew calendar of dates prior to -003760-09-07
// On Android, hebrew calendar is only available on he locale.
let dateOK = new Date (Date.UTC(-3760, 8, 7));
let dateKO = new Date (Date.UTC(-3760, 8, 6));
let dateDisplay = new Intl.DateTimeFormat (
'he-u-ca-hebrew',
{ timeZone : 'UTC', year : 'numeric', month :'long',
day : 'numeric', weekday : 'long' });
assertEquals("Mon, 07 Sep -3760 00:00:00 GMT",
dateOK.toUTCString(), "dateOK.toUTCString()");
assertEquals("Sun, 06 Sep -3760 00:00:00 GMT",
dateKO.toUTCString(), "dateKO.toUTCString()");
assertEquals("יום שני, 1 בתשרי 1",
dateDisplay.format(dateOK), "dateDisplay.format(dateOK)");
assertEquals("יום ראשון, 29 באלול 0",
dateDisplay.format(dateKO), "dateDisplay.format(dateKO)");