File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -69,13 +69,13 @@ public static function normalizeMemoryUsage(string $output): string
69
69
public static function normalizeProgressBarTimeTaken (string $ output ): string
70
70
{
71
71
$ output = str_replace (
72
- '< 1 sec ' ,
73
- '10 secs ' ,
72
+ [ '< 1 sec ' , ' < 1 ms ' ] ,
73
+ [ '10 secs ' , ' 10 secs ' ] ,
74
74
$ output ,
75
75
);
76
76
77
77
return preg_replace (
78
- '/\d+ secs?/ ' ,
78
+ '/\d+ ( secs?|ms|s) / ' ,
79
79
'10 secs ' ,
80
80
$ output ,
81
81
);
Original file line number Diff line number Diff line change @@ -88,6 +88,16 @@ public static function progressBarTimeTakenProvider(): iterable
88
88
' 10 secs ' ,
89
89
];
90
90
91
+ yield '[non-fixed size bar] millisecond ' => [
92
+ ' 243 ms ' ,
93
+ ' 10 secs ' ,
94
+ ];
95
+
96
+ yield '[non-fixed size bar] second ' => [
97
+ ' 1 s ' ,
98
+ ' 10 secs ' ,
99
+ ];
100
+
91
101
yield '[non-fixed size bar] single digit ' => [
92
102
' 7 secs ' ,
93
103
' 10 secs ' ,
@@ -103,6 +113,11 @@ public static function progressBarTimeTakenProvider(): iterable
103
113
' 10 secs/10 secs ' ,
104
114
];
105
115
116
+ yield '[fixed size bar] less than a millisecond ' => [
117
+ ' < 1 ms/< 1 ms ' ,
118
+ ' 10 secs/10 secs ' ,
119
+ ];
120
+
106
121
yield '[fixed size bar] single digit ' => [
107
122
' 4 secs/7 secs ' ,
108
123
' 10 secs/10 secs ' ,
@@ -426,6 +441,11 @@ public static function outputProvider(): iterable
426
441
' 4 [--->------------------------] 10 secs 10.0 MiB ' ,
427
442
];
428
443
444
+ yield 'standard non-fixed sized progress bar line with ms ' => [
445
+ ' 4 [--->------------------------] < 1 ms 8.0 MiB ' ,
446
+ ' 4 [--->------------------------] 10 secs 10.0 MiB ' ,
447
+ ];
448
+
429
449
yield 'standard non-fixed sized progress bar line with extra padding ' => [
430
450
' 4 [--->------------------------] < 1 sec 8.0 MiB ' ,
431
451
' 4 [--->------------------------] 10 secs 10.0 MiB ' ,
You can’t perform that action at this time.
0 commit comments