Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



+-------+-------------------------------+------------------------------+
| # | 0 | 1 |
+-------+-------------------------------+------------------------------+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
+-------+-------------------------------+------------------------------+
| order | 2 | 1 |
+-------+-------------------------------+------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



+-------+-------------------------------+------------------------------+
| # | 0 | 1 |
+-------+-------------------------------+------------------------------+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
+-------+-------------------------------+------------------------------+
| order | 2 | 1 |
+-------+-------------------------------+------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



+-------+-------------------------------+------------------------------+
| # | 0 | 1 |
+-------+-------------------------------+------------------------------+
| min | 15.67890123 ms - 202 bytes | 2.3456789 ms - 102 bytes |
| max | 112.78901234 ms - 209 bytes | 9.75678901 ms - 109 bytes |
| avg | 53.02524845125 ms - 205 bytes | 5.94290024625 ms - 105 bytes |
| total | 424.20198761 ms - 1.61 KB | 47.54320197 ms - 844 bytes |
+-------+-------------------------------+------------------------------+
| order | 2 | 1 |
+-------+-------------------------------+------------------------------+
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@


0/1 [░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0% 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%



Expand Down
30 changes: 30 additions & 0 deletions tests/Unit/Result/EnabledProgressBar.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

use DragonCode\Benchmark\Benchmark;
use Tests\Fixtures\CollectorFixture;

test('to console', function (int $iterations) {
(new Benchmark(collector: new CollectorFixture))
->iterations($iterations)
->toConsole();

expectOutputToMatchSnapshot();
})->with([3, 1000, 10000]);

test('to data', function (int $iterations) {
(new Benchmark(collector: new CollectorFixture))
->iterations($iterations)
->toData();

expectOutputToMatchSnapshot();
})->with([3, 1000, 10000]);

test('to assert', function (int $iterations) {
(new Benchmark(collector: new CollectorFixture))
->iterations($iterations)
->toAssert();

expectOutputToMatchSnapshot();
})->with([3, 1000, 10000]);
Loading