Skip to content

Commit bc5c746

Browse files
Merge pull request #114
Added tests for `EnabledProgressBar`
2 parents 5b44605 + 0c532ab commit bc5c746

10 files changed

+114
-0
lines changed

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_assert_with_data_set___10000__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_assert_with_data_set___1000__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_assert_with_data_set___3__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_console_with_data_set___10000__.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+
7+
+-------+-------------------------------+------------------------------+
8+
| # | 0 | 1 |
9+
+-------+-------------------------------+------------------------------+
10+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
11+
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
12+
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
13+
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
14+
+-------+-------------------------------+------------------------------+
15+
| order | 2 | 1 |
16+
+-------+-------------------------------+------------------------------+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_console_with_data_set___1000__.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+
7+
+-------+-------------------------------+------------------------------+
8+
| # | 0 | 1 |
9+
+-------+-------------------------------+------------------------------+
10+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
11+
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
12+
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
13+
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
14+
+-------+-------------------------------+------------------------------+
15+
| order | 2 | 1 |
16+
+-------+-------------------------------+------------------------------+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_console_with_data_set___3__.snap

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+
7+
+-------+-------------------------------+------------------------------+
8+
| # | 0 | 1 |
9+
+-------+-------------------------------+------------------------------+
10+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
11+
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
12+
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
13+
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
14+
+-------+-------------------------------+------------------------------+
15+
| order | 2 | 1 |
16+
+-------+-------------------------------+------------------------------+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_data_with_data_set___10000__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_data_with_data_set___1000__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+

tests/.pest/snapshots/Unit/Result/EnabledProgressBar/to_data_with_data_set___3__.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
3+
0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
4+
5+
6+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\Benchmark\Benchmark;
6+
use Tests\Fixtures\CollectorFixture;
7+
8+
test('to console', function (int $iterations) {
9+
(new Benchmark(collector: new CollectorFixture))
10+
->iterations($iterations)
11+
->toConsole();
12+
13+
expectOutputToMatchSnapshot();
14+
})->with([3, 1000, 10000]);
15+
16+
test('to data', function (int $iterations) {
17+
(new Benchmark(collector: new CollectorFixture))
18+
->iterations($iterations)
19+
->toData();
20+
21+
expectOutputToMatchSnapshot();
22+
})->with([3, 1000, 10000]);
23+
24+
test('to assert', function (int $iterations) {
25+
(new Benchmark(collector: new CollectorFixture))
26+
->iterations($iterations)
27+
->toAssert();
28+
29+
expectOutputToMatchSnapshot();
30+
})->with([3, 1000, 10000]);

0 commit comments

Comments
 (0)