File: 0006-tests-Update-number-of-plural-rules-for-pt.patch

package info (click to toggle)
php-oscarotero-gettext 4.8.7-3
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,624 kB
  • sloc: php: 5,213; xml: 22; javascript: 18; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 1,069 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: James Valleroy <jvalleroy@mailbox.org>
Date: Mon, 19 Sep 2022 15:55:20 -0400
Subject: tests: Update number of plural rules for pt

This changed due to php-gettext-languages v2.9.0:

Updated CLDR data from v39 to v40 (#44)
The most notable changes is that the number of plural rules changed
for Italian, Portuguese, and Spanish
See https://cldr.unicode.org/index/downloads/cldr-40 for more details
---
 tests/LocalesTest.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/LocalesTest.php b/tests/LocalesTest.php
index 1354537..8b4191a 100644
--- a/tests/LocalesTest.php
+++ b/tests/LocalesTest.php
@@ -35,8 +35,8 @@ class LocalesTest extends AbstractTest
 
         $pluralForms = $translations->getPluralForms();
 
-        $this->assertEquals(2, $pluralForms[0]);
-        $this->assertEquals('n > 1', $pluralForms[1]);
+        $this->assertEquals(3, $pluralForms[0]);
+        $this->assertEquals('(n == 0 || n == 1) ? 0 : ((n != 0 && n % 1000000 == 0) ? 1 : 2)', $pluralForms[1]);
 
         $translations->setLanguage('az');