@@ -123,10 +123,10 @@ def out(*args, want_rc=0, env=None, text=True):
123123 test_fail (f"--stats without -h unexpectedly used a unit suffix:\n { plain } " )
124124
125125for label , options , progress_re in (
126- ('default' , (), r'50[,. ]000B\s+100%\s+[\d.,]+[KMGTPE]B/s' ),
126+ ('default' , (), r'50[., ]000B\s+100%\s+[\d.,]+[KMGTPE]B/s' ),
127127 ('--no-h' , ('--no-h' ,), r'50000B\s+100%\s+\d+B/s' ),
128- ('-h' , ('-h' ,), r'50\. 0KB\s+100%\s+[\d.,]+[KMGTPE]B/s' ),
129- ('-hh' , ('-hh' ,), r'48\. 8KiB\s+100%\s+[\d.,]+[KMGTPE]iB/s' ),
128+ ('-h' , ('-h' ,), r'50[.,] 0KB\s+100%\s+[\d.,]+[KMGTPE]B/s' ),
129+ ('-hh' , ('-hh' ,), r'48[.,] 8KiB\s+100%\s+[\d.,]+[KMGTPE]iB/s' ),
130130):
131131 rmtree (TODIR )
132132 progress = out ('-a' , '--progress' , * options , f'{ src } /' , f'{ TODIR } /' ).stdout
@@ -135,23 +135,23 @@ def out(*args, want_rc=0, env=None, text=True):
135135
136136rmtree (TODIR )
137137human_binary = out ('-a' , '-hh' , '--stats' , f'{ src } /' , f'{ TODIR } /' ).stdout
138- if 'Total file size: 48. 8Ki bytes' not in human_binary :
138+ if not re . search ( r 'Total file size: 48[.,] 8Ki bytes', human_binary ) :
139139 test_fail (f"-hh did not use dynamic binary-unit precision:\n { human_binary } " )
140140
141141rmtree (src )
142142rmtree (TODIR )
143143makepath (src )
144144make_data_file (src / 'threshold' , 1024 )
145145threshold = out ('-a' , '-hh' , '--stats' , f'{ src } /' , f'{ TODIR } /' ).stdout
146- if 'Total file size: 1. 00Ki bytes' not in threshold :
146+ if not re . search ( r 'Total file size: 1[.,] 00Ki bytes', threshold ) :
147147 test_fail (f"-hh did not show an exact-threshold binary unit:\n { threshold } " )
148148
149149rmtree (src )
150150rmtree (TODIR )
151151makepath (src )
152152make_data_file (src / 'below-threshold' , 1000 )
153153below_threshold = out ('-a' , '-hh' , '--stats' , f'{ src } /' , f'{ TODIR } /' ).stdout
154- if 'Total file size: 1, 000 bytes' not in below_threshold :
154+ if not re . search ( r 'Total file size: 1[.,] 000 bytes', below_threshold ) :
155155 test_fail ("-hh should preserve raw byte formatting below the binary-unit "
156156 f"threshold:\n { below_threshold } " )
157157
@@ -162,7 +162,7 @@ def out(*args, want_rc=0, env=None, text=True):
162162for i in range (999 ):
163163 (src / f'f{ i } ' ).touch ()
164164counts = out ('-a' , '-hh' , '--progress' , '--no-i-r' , f'{ src } /' , f'{ TODIR } /' ).stdout
165- if '1, 000 files to consider' not in counts :
165+ if not re . search ( r'1[.,] 000 files to consider', counts ) :
166166 test_fail (f"file-list count was not grouped:\n { counts } " )
167167rmtree (TODIR )
168168counts = out ('-a' , '--no-h' , '--progress' , '--no-i-r' , f'{ src } /' , f'{ TODIR } /' ).stdout
0 commit comments