Codebase list golang-github-vbauerster-mpb / c2e1007
Revert "speed_test: refactoring elapsed arg" This reverts commit 12219b776cbab121887468687793853c01eefc57. Vladimir Bauer 3 years ago
1 changed file(s) with 22 addition(s) and 22 deletion(s). Raw diff Collapse all Expand all
1818 unit: SizeB1024(0),
1919 fmt: "",
2020 current: 0,
21 elapsed: time.Duration(0),
21 elapsed: time.Second,
2222 expected: "0 b/s",
2323 },
2424 {
2626 unit: SizeB1024(0),
2727 fmt: "%d",
2828 current: 0,
29 elapsed: time.Duration(0),
29 elapsed: time.Second,
3030 expected: "0b/s",
3131 },
3232 {
4242 unit: SizeB1024(0),
4343 fmt: "% .2f",
4444 current: 0,
45 elapsed: time.Duration(0),
45 elapsed: time.Second,
4646 expected: "0.00 b/s",
4747 },
4848 {
6666 unit: SizeB1024(0),
6767 fmt: "%d",
6868 current: 2 * int64(_iKiB),
69 elapsed: time.Second,
69 elapsed: 1 * time.Second,
7070 expected: "2KiB/s",
7171 },
7272 {
7474 unit: SizeB1024(0),
7575 fmt: "% .2f",
7676 current: 2 * int64(_iKiB),
77 elapsed: time.Second,
77 elapsed: 1 * time.Second,
7878 expected: "2.00 KiB/s",
7979 },
8080 {
8282 unit: SizeB1024(0),
8383 fmt: "%d",
8484 current: 2 * int64(_iMiB),
85 elapsed: time.Second,
85 elapsed: 1 * time.Second,
8686 expected: "2MiB/s",
8787 },
8888 {
9090 unit: SizeB1024(0),
9191 fmt: "% .2f",
9292 current: 2 * int64(_iMiB),
93 elapsed: time.Second,
93 elapsed: 1 * time.Second,
9494 expected: "2.00 MiB/s",
9595 },
9696 {
9898 unit: SizeB1024(0),
9999 fmt: "%d",
100100 current: 2 * int64(_iGiB),
101 elapsed: time.Second,
101 elapsed: 1 * time.Second,
102102 expected: "2GiB/s",
103103 },
104104 {
106106 unit: SizeB1024(0),
107107 fmt: "% .2f",
108108 current: 2 * int64(_iGiB),
109 elapsed: time.Second,
109 elapsed: 1 * time.Second,
110110 expected: "2.00 GiB/s",
111111 },
112112 {
114114 unit: SizeB1024(0),
115115 fmt: "%d",
116116 current: 2 * int64(_iTiB),
117 elapsed: time.Second,
117 elapsed: 1 * time.Second,
118118 expected: "2TiB/s",
119119 },
120120 {
122122 unit: SizeB1024(0),
123123 fmt: "% .2f",
124124 current: 2 * int64(_iTiB),
125 elapsed: time.Second,
125 elapsed: 1 * time.Second,
126126 expected: "2.00 TiB/s",
127127 },
128128 }
154154 unit: SizeB1000(0),
155155 fmt: "",
156156 current: 0,
157 elapsed: time.Duration(0),
157 elapsed: time.Second,
158158 expected: "0 b/s",
159159 },
160160 {
162162 unit: SizeB1000(0),
163163 fmt: "%d",
164164 current: 0,
165 elapsed: time.Duration(0),
165 elapsed: time.Second,
166166 expected: "0b/s",
167167 },
168168 {
178178 unit: SizeB1000(0),
179179 fmt: "% .2f",
180180 current: 0,
181 elapsed: time.Duration(0),
181 elapsed: time.Second,
182182 expected: "0.00 b/s",
183183 },
184184 {
202202 unit: SizeB1000(0),
203203 fmt: "%d",
204204 current: 2 * int64(_KB),
205 elapsed: time.Second,
205 elapsed: 1 * time.Second,
206206 expected: "2KB/s",
207207 },
208208 {
210210 unit: SizeB1000(0),
211211 fmt: "% .2f",
212212 current: 2 * int64(_KB),
213 elapsed: time.Second,
213 elapsed: 1 * time.Second,
214214 expected: "2.00 KB/s",
215215 },
216216 {
218218 unit: SizeB1000(0),
219219 fmt: "%d",
220220 current: 2 * int64(_MB),
221 elapsed: time.Second,
221 elapsed: 1 * time.Second,
222222 expected: "2MB/s",
223223 },
224224 {
226226 unit: SizeB1000(0),
227227 fmt: "% .2f",
228228 current: 2 * int64(_MB),
229 elapsed: time.Second,
229 elapsed: 1 * time.Second,
230230 expected: "2.00 MB/s",
231231 },
232232 {
234234 unit: SizeB1000(0),
235235 fmt: "%d",
236236 current: 2 * int64(_GB),
237 elapsed: time.Second,
237 elapsed: 1 * time.Second,
238238 expected: "2GB/s",
239239 },
240240 {
242242 unit: SizeB1000(0),
243243 fmt: "% .2f",
244244 current: 2 * int64(_GB),
245 elapsed: time.Second,
245 elapsed: 1 * time.Second,
246246 expected: "2.00 GB/s",
247247 },
248248 {
250250 unit: SizeB1000(0),
251251 fmt: "%d",
252252 current: 2 * int64(_TB),
253 elapsed: time.Second,
253 elapsed: 1 * time.Second,
254254 expected: "2TB/s",
255255 },
256256 {
258258 unit: SizeB1000(0),
259259 fmt: "% .2f",
260260 current: 2 * int64(_TB),
261 elapsed: time.Second,
261 elapsed: 1 * time.Second,
262262 expected: "2.00 TB/s",
263263 },
264264 }