File tree Expand file tree Collapse file tree 3 files changed +30
-5
lines changed
Expand file tree Collapse file tree 3 files changed +30
-5
lines changed Original file line number Diff line number Diff line change 1818use function abs ;
1919use function array_first ;
2020use function count ;
21- use function func_get_args ;
2221use function is_array ;
2322use function is_callable ;
2423use function max ;
@@ -103,12 +102,10 @@ public function round(?int $precision): static
103102
104103 public function compare (array |Closure ...$ callbacks ): static
105104 {
106- $ values = $ this ->resolveCallbacks (
107- func_get_args () ?: $ callbacks
108- );
109-
110105 $ this ->clear ();
111106
107+ $ values = $ this ->resolveCallbacks ($ callbacks );
108+
112109 $ this ->withProgress ($ values , $ this ->steps ($ values ));
113110
114111 return $ this ;
Original file line number Diff line number Diff line change 2727 1 ,
2828 ]);
2929});
30+
31+ test ('mixed names ' , function () {
32+ $ results = benchmark (false )->compare ([
33+ static fn () => true ,
34+ 'foo ' => static fn () => true ,
35+ 'bar ' => static fn () => false ,
36+ ])->toData ();
37+
38+ expect ($ results )->toHaveKeys ([
39+ 0 ,
40+ 'foo ' ,
41+ 'bar ' ,
42+ ]);
43+ });
Original file line number Diff line number Diff line change 2727 1 ,
2828 ]);
2929});
30+
31+ test ('mixed names ' , function () {
32+ $ results = benchmark (false )->compare (
33+ static fn () => true ,
34+ foo: static fn () => true ,
35+ bar: static fn () => false ,
36+ )->toData ();
37+
38+ expect ($ results )->toHaveKeys ([
39+ 0 ,
40+ 'foo ' ,
41+ 'bar ' ,
42+ ]);
43+ });
You can’t perform that action at this time.
0 commit comments