Skip to content

Commit

Permalink
upgrade cldr data to v44
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmajor committed Nov 24, 2023
1 parent 4665db4 commit 481f4cc
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"dependencies": {
"cldr-core": "^43.0"
"cldr-core": "^44.0"
}
}
8 changes: 8 additions & 0 deletions rules/blo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use function Major\PluralRules\Operands\n;

return [
'zero' => fn ($n) => n($n) == 0,
'one' => fn ($n) => n($n) == 1,
];
88 changes: 88 additions & 0 deletions tests/Locale/BloTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<?php

namespace Major\PluralRules\Tests\Locale;

use Major\PluralRules\PluralRules;
use PHPUnit\Framework\TestCase;

final class BloTest extends TestCase
{
/**
* @dataProvider provideZeroCases
*/
public function testZero(int|float|string $num): void
{
$category = PluralRules::select('blo', $num);
$this->assertSame('zero', $category);
}

/**
* @return list<array{int|float|string}>
*/
public static function provideZeroCases(): array
{
return [
[0],
[0.0],
['0.00'],
['0.000'],
['0.0000'],
];
}

/**
* @dataProvider provideOneCases
*/
public function testOne(int|float|string $num): void
{
$category = PluralRules::select('blo', $num);
$this->assertSame('one', $category);
}

/**
* @return list<array{int|float|string}>
*/
public static function provideOneCases(): array
{
return [
[1],
[1.0],
['1.00'],
['1.000'],
['1.0000'],
];
}

/**
* @dataProvider provideOtherCases
*/
public function testOther(int|float|string $num): void
{
$category = PluralRules::select('blo', $num);
$this->assertSame('other', $category);
}

/**
* @return list<array{int|float|string}>
*/
public static function provideOtherCases(): array
{
return [
[2],
[16],
[100],
[1000],
[10000],
[100000],
[1000000],
[2.0],
[2.5],
[10.0],
[100.0],
[1000.0],
[10000.0],
[100000.0],
[1000000.0],
];
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


cldr-core@^43.0:
version "43.1.0"
resolved "https://registry.yarnpkg.com/cldr-core/-/cldr-core-43.1.0.tgz#aebb5c4b5dcb5a6607e8d3bf2bf1fe29b75ef2fa"
integrity sha512-8Q/Zh/eCzV4SxggzZhPnw5WDWH9OnhbPfwzthfG8uXsCn7F5UeBCiAOTxsstxuxtXPKlvPJqqMSQjiYcqJPJsA==
cldr-core@^44.0:
version "44.0.1"
resolved "https://registry.yarnpkg.com/cldr-core/-/cldr-core-44.0.1.tgz#d1c68770f252a6e1229f79c8edea082153908ecf"
integrity sha512-k+Mgsb/VbCYCJHhdL/ej+qyNNFs9OB8fOmi/tpa8L+vkbX3ksn1MizUtToKU827Y1XUfT0TAaybmLA+7cEqx7Q==

0 comments on commit 481f4cc

Please sign in to comment.