Skip to content

Commit

Permalink
test: Add cases for accounting for the rounding (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Aug 6, 2024
1 parent 307cd98 commit 8520451
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/CpuCoreCounterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,36 @@ public static function availableCpuCoreProvider(): iterable
9.5,
10
);

yield 'it rounds the available cores to the lower int (less than half)' => AvailableCpuCoresScenario::create(
32,
[],
0,
null,
.1,
0.,
3
);

yield 'it rounds the available cores to the lower int (perfect half)' => AvailableCpuCoresScenario::create(
7,
[],
0,
null,
.5,
0.,
3
);

yield 'it rounds the available cores to the lower int (more than half)' => AvailableCpuCoresScenario::create(
36,
[],
0,
null,
.1,
0.,
3
);
}

/**
Expand Down

0 comments on commit 8520451

Please sign in to comment.