[Pkg-roundcube-maintainers] Bug#1030161: roundcube: Fix short date test before and after ICU 72.1

Amin Bandali amin.bandali at canonical.com
Tue Jan 31 18:38:20 GMT 2023


Source: roundcube
Version: 1.6.0+dfsg-1
Severity: normal
Tags: patch

Hello there,

Would you please consider adopting the attached patch (also forwarded
and applied upstream) for fixing the test suite breakage both before
and after ICU 72.1?  Though Debian unstable and testing already have
ICU 72.1, Ubuntu lunar (devel) is still on 71.1, and it would be great
if this failure was fixed such that roundcube would build with ICU
both older or newer than 72.1.

Thanks,
amin

-------------- next part --------------
>From 65c93a6d80218b288e5178ba2692da563bb5015e Mon Sep 17 00:00:00 2001
From: Amin Bandali <amin.bandali at canonical.com>
Date: Tue, 31 Jan 2023 11:08:23 -0500
Subject: [PATCH] Fix broken short date test with ICU >= 72.1
Forwarded: https://github.com/roundcube/roundcubemail/pull/8904
Applied-Upstream: 5d99ffb766bdb49efb2a8fe9d611f02d5776d0f2
Last-Update: 2023-01-31

* tests/Rcmail/Rcmail.php (test_format_date): Starting with ICU 72.1,
a NARROW NO-BREAK SPACE (NNBSP) is used instead of an ASCII space
before the meridian.  So, check for an NNBSP when using ICU >= 72.1.

References:
* https://icu.unicode.org/download/72
* https://cldr.unicode.org/index/downloads/cldr-42
* https://github.com/unicode-org/icu/pull/2103
---
 tests/Rcmail/Rcmail.php | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/Rcmail/Rcmail.php b/tests/Rcmail/Rcmail.php
index 48879b3a7..4a16b38d4 100644
--- a/tests/Rcmail/Rcmail.php
+++ b/tests/Rcmail/Rcmail.php
@@ -279,7 +279,14 @@ class Rcmail_Rcmail extends ActionTestCase
         $this->assertSame(' Mon', $rcmail->format_date($date, ' D'));
         $this->assertSame('D Monday', $rcmail->format_date($date, '\\D l'));
         $this->assertSame('Jun June', $rcmail->format_date($date, 'M F'));
-        $this->assertSame('6/1/20, 12:20 PM', $rcmail->format_date($date, 'x'));
+        $date_x = '6/1/20, 12:20 PM';
+        if (defined('INTL_ICU_VERSION')
+              && version_compare(INTL_ICU_VERSION, '72.1', '>=')) {
+            // Starting with ICU 72.1, a NARROW NO-BREAK SPACE (NNBSP)
+            // is used instead of an ASCII space before the meridian.
+            $date_x = '6/1/20, 12:20?PM';
+        }
+        $this->assertSame($date_x, $rcmail->format_date($date, 'x'));
         $this->assertSame('1591014030', $rcmail->format_date($date, 'U'));
         $this->assertSame('2020-06-01T12:20:30+00:00', $rcmail->format_date($date, 'c'));
     }
-- 
2.37.2



More information about the Pkg-roundcube-maintainers mailing list