Codebase list golang-github-vbauerster-mpb / 12219b7
speed_test: refactoring elapsed arg 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.Second,
21 elapsed: time.Duration(0),
2222 expected: "0 b/s",
2323 },
2424 {
2626 unit: SizeB1024(0),
2727 fmt: "%d",
2828 current: 0,
29 elapsed: time.Second,
29 elapsed: time.Duration(0),
3030 expected: "0b/s",
3131 },
3232 {
3434 unit: SizeB1024(0),
3535 fmt: "% .2f",
3636 current: 0,
37 elapsed: time.Second,
37 elapsed: time.Duration(0),
3838 expected: "0.00 b/s",
3939 },
4040 {
5858 unit: SizeB1024(0),
5959 fmt: "%d",
6060 current: 2 * int64(_iKiB),
61 elapsed: 1 * time.Second,
61 elapsed: time.Second,
6262 expected: "2KiB/s",
6363 },
6464 {
6666 unit: SizeB1024(0),
6767 fmt: "% .2f",
6868 current: 2 * int64(_iKiB),
69 elapsed: 1 * time.Second,
69 elapsed: time.Second,
7070 expected: "2.00 KiB/s",
7171 },
7272 {
7474 unit: SizeB1024(0),
7575 fmt: "%d",
7676 current: 2 * int64(_iMiB),
77 elapsed: 1 * time.Second,
77 elapsed: time.Second,
7878 expected: "2MiB/s",
7979 },
8080 {
8282 unit: SizeB1024(0),
8383 fmt: "% .2f",
8484 current: 2 * int64(_iMiB),
85 elapsed: 1 * time.Second,
85 elapsed: time.Second,
8686 expected: "2.00 MiB/s",
8787 },
8888 {
9090 unit: SizeB1024(0),
9191 fmt: "%d",
9292 current: 2 * int64(_iGiB),
93 elapsed: 1 * time.Second,
93 elapsed: time.Second,
9494 expected: "2GiB/s",
9595 },
9696 {
9898 unit: SizeB1024(0),
9999 fmt: "% .2f",
100100 current: 2 * int64(_iGiB),
101 elapsed: 1 * time.Second,
101 elapsed: time.Second,
102102 expected: "2.00 GiB/s",
103103 },
104104 {
106106 unit: SizeB1024(0),
107107 fmt: "%d",
108108 current: 2 * int64(_iTiB),
109 elapsed: 1 * time.Second,
109 elapsed: time.Second,
110110 expected: "2TiB/s",
111111 },
112112 {
114114 unit: SizeB1024(0),
115115 fmt: "% .2f",
116116 current: 2 * int64(_iTiB),
117 elapsed: 1 * time.Second,
117 elapsed: time.Second,
118118 expected: "2.00 TiB/s",
119119 },
120120 }
146146 unit: SizeB1000(0),
147147 fmt: "",
148148 current: 0,
149 elapsed: time.Second,
149 elapsed: time.Duration(0),
150150 expected: "0 b/s",
151151 },
152152 {
154154 unit: SizeB1000(0),
155155 fmt: "%d",
156156 current: 0,
157 elapsed: time.Second,
157 elapsed: time.Duration(0),
158158 expected: "0b/s",
159159 },
160160 {
162162 unit: SizeB1000(0),
163163 fmt: "% .2f",
164164 current: 0,
165 elapsed: time.Second,
165 elapsed: time.Duration(0),
166166 expected: "0.00 b/s",
167167 },
168168 {
186186 unit: SizeB1000(0),
187187 fmt: "%d",
188188 current: 2 * int64(_KB),
189 elapsed: 1 * time.Second,
189 elapsed: time.Second,
190190 expected: "2KB/s",
191191 },
192192 {
194194 unit: SizeB1000(0),
195195 fmt: "% .2f",
196196 current: 2 * int64(_KB),
197 elapsed: 1 * time.Second,
197 elapsed: time.Second,
198198 expected: "2.00 KB/s",
199199 },
200200 {
202202 unit: SizeB1000(0),
203203 fmt: "%d",
204204 current: 2 * int64(_MB),
205 elapsed: 1 * time.Second,
205 elapsed: time.Second,
206206 expected: "2MB/s",
207207 },
208208 {
210210 unit: SizeB1000(0),
211211 fmt: "% .2f",
212212 current: 2 * int64(_MB),
213 elapsed: 1 * time.Second,
213 elapsed: time.Second,
214214 expected: "2.00 MB/s",
215215 },
216216 {
218218 unit: SizeB1000(0),
219219 fmt: "%d",
220220 current: 2 * int64(_GB),
221 elapsed: 1 * time.Second,
221 elapsed: time.Second,
222222 expected: "2GB/s",
223223 },
224224 {
226226 unit: SizeB1000(0),
227227 fmt: "% .2f",
228228 current: 2 * int64(_GB),
229 elapsed: 1 * time.Second,
229 elapsed: time.Second,
230230 expected: "2.00 GB/s",
231231 },
232232 {
234234 unit: SizeB1000(0),
235235 fmt: "%d",
236236 current: 2 * int64(_TB),
237 elapsed: 1 * time.Second,
237 elapsed: time.Second,
238238 expected: "2TB/s",
239239 },
240240 {
242242 unit: SizeB1000(0),
243243 fmt: "% .2f",
244244 current: 2 * int64(_TB),
245 elapsed: 1 * time.Second,
245 elapsed: time.Second,
246246 expected: "2.00 TB/s",
247247 },
248248 }