Skip to content

Commit

Permalink
Make date-time-format tests more permissive (facebook#1179)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#1179

Upgrading to MacOS Sonoma breaks tests related to formatting date with
Intl enabled, likely caused by the underlying ICU upgrades. Make these
tests more permissive by replacing some " " and "," with regex matching
any.

Reviewed By: neildhar

Differential Revision: D50800570

fbshipit-source-id: 9370970a968e80857ceb35db8d70e9eaa5f9eb52
  • Loading branch information
lavenzg authored and facebook-github-bot committed Oct 30, 2023
1 parent 1e5322f commit 5eac805
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/hermes/intl/date-time-format-apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ print(new Intl.DateTimeFormat('de-DE').format(oldDate));
// CHECK-NEXT: 9.1.1952

print(new Intl.DateTimeFormat('en-US', { timeStyle: 'long', timeZone: 'PST'}).format(date));
// CHECK-NEXT: 7:45:00 PM PST
// CHECK-NEXT: 7:45:00{{.+}}PM PST

print(new Intl.DateTimeFormat('en-US', { timeStyle: 'long', timeZone: 'EET'}).format(date));
// CHECK-NEXT: 5:45:00 AM GMT+2
// CHECK-NEXT: 5:45:00{{.+}}AM GMT+2

try {
print(new Intl.DateTimeFormat('en-US', { timeStyle: 'long', timeZone: 'XXX'}).format(date));
Expand All @@ -54,13 +54,13 @@ print(new Intl.DateTimeFormat('ko-KR', { dateStyle: 'medium', timeStyle: 'medium
// CHECK-NEXT: 2020. 1. 2. 오전 3:45:00

print(new Intl.DateTimeFormat('en-US', { dateStyle: 'short', timeStyle: 'medium' }).format(oldDate));
// CHECK-NEXT: 1/9/52, 8:04:03 AM
// CHECK-NEXT: 1/9/52, 8:04:03{{.+}}AM

print(new Intl.DateTimeFormat('de-DE', { dateStyle: 'full', timeStyle: 'long' }).format(oldDate));
// CHECK-NEXT: Mittwoch, 9. Januar 1952 um 08:04:03 GMT

print(new Intl.DateTimeFormat('it-IT', { dateStyle: 'long', timeStyle: 'short' }).format(oldDate))
// CHECK-NEXT: 9 gennaio 1952, 08:04
// CHECK-NEXT: 9 gennaio 1952{{.+}}08:04

const lengthOptions = ['narrow', 'short', 'long'];
const numericOptions = ['numeric', '2-digit'];
Expand Down

0 comments on commit 5eac805

Please sign in to comment.