[Webkit-unassigned] [Bug 196395] REGRESSION(r243512): Change locale of test in intl-datetimeformat.js

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 1 04:28:36 PDT 2019


https://bugs.webkit.org/show_bug.cgi?id=196395

--- Comment #7 from Diego Pino <dpino at igalia.com> ---
I run the test in an old version of WebKit (WebKit v2.22.6), and the 2-digit issue happens also if 'en' locale is used:

> Intl.DateTimeFormat('en', {minute: '2-digit', hour: '2-digit', hour12: true, timezone: 'UTC'}).format(1e7)
< "3:46 AM"

(See attachment)

Regarding isolating the test in a different file (so there's different outputs per platform), the problem is the test is valid for GTK but it fails because of the localized string. So this is more about expecting a different actual result per platform. In fact, the original issue that r243512 solves states that valid outputs for this test are:

03:00
03:00 AM (or a Cyrillic alternative to "AM")

https://bugs.webkit.org/show_bug.cgi?id=195974

(In r243512, 10e7 is used instead of a number value equivalent to '03:00 AM').

So an alternative solution would be to modify the test to expect all these possible valid outputs. For instance:

shouldBeTrue("['02:46 ДП', '02:46 AM', '02:46'].includes(Intl.DateTimeFormat('ru', { minute:'2-digit', hour:'2-digit', hour12: true, timeZone: 'UTC' }).format(1e7))");

Whether to change the locale to 'en' or adapt the test to expect different valid outputs works for me, although I have a preference for changing the locale to a language where am_pm string is normally translated (as in English), so the output of the test is different than the same test where `hour12: false`.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190401/51eebc1a/attachment.html>


More information about the webkit-unassigned mailing list