Skip to content

Commit

Permalink
Testing negative byte value in getHumanReadableSize() support function
Browse files Browse the repository at this point in the history
  • Loading branch information
TheXerr0r committed Feb 15, 2024
1 parent a2bcea1 commit 06e8fb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/Support/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
expect(File::getHumanReadableSize(1000))->toEqual('1000 B');
expect(File::getHumanReadableSize(10000))->toEqual('9.77 KB');
expect(File::getHumanReadableSize(10000))->toEqual('9.77 KB');
expect(File::getHumanReadableSize(-10000))->toEqual('9.77 KB');
$this->assertEquals('976.56 KB', File::getHumanReadableSize(1_000_000));
$this->assertEquals('9.54 MB', File::getHumanReadableSize(10_000_000));
$this->assertEquals('9.31 GB', File::getHumanReadableSize(10_000_000_000));
Expand All @@ -16,6 +17,7 @@
$this->assertEquals('86.74 EB', File::getHumanReadableSize(100_000_000_000_000_000_000));
$this->assertEquals('84.7 ZB', File::getHumanReadableSize(100_000_000_000_000_000_000_000));
$this->assertEquals('82.72 YB', File::getHumanReadableSize(100_000_000_000_000_000_000_000_000));
$this->assertEquals('82.72 YB', File::getHumanReadableSize(-100_000_000_000_000_000_000_000_000));
});

it('can determine the mime type of a file', function () {
Expand Down

0 comments on commit 06e8fb8

Please sign in to comment.