Skip to content

Commit

Permalink
use emoticons in generated names to check it supports utf8 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
Baptouuuu committed Mar 16, 2024
1 parent e8f484c commit 2f84561
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Changed

- Special ASCII characters are no longer used in genarated names via `Fixtures\Innmind\Filesystem\Name::any()`
- Emoticon characters are now used in genarated names via `Fixtures\Innmind\Filesystem\Name::any()`

## 7.4.0 - 2023-12-02

Expand Down
2 changes: 2 additions & 0 deletions fixtures/Name.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ public static function strings(): Set
return Set\Strings::madeOf(
Set\Integers::between(32, 46)->map(\chr(...)),
Set\Integers::between(48, 126)->map(\chr(...)),
Set\Unicode::emoticons(),
)
->between(1, 255)
->filter(static fn($name) => \mb_strlen($name, 'ASCII') <= 255)
->filter(
static fn(string $name): bool => $name !== '.' &&
$name !== '..' &&
Expand Down
3 changes: 2 additions & 1 deletion tests/Adapter/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ public function testDotFilesAreListed()
$name = ".$name";
$path = \sys_get_temp_dir().'/innmind/filesystem/';
(new FS)->remove($path);
(new FS)->dumpFile($path.$name, 'bar');
(new FS)->mkdir($path);
\file_put_contents($path.$name, 'bar');

$filesystem = Filesystem::mount(Path::of($path));

Expand Down

0 comments on commit 2f84561

Please sign in to comment.