@@ -210,13 +210,17 @@ func TestParseStringAsBytes(t *testing.T) {
210
210
error bool
211
211
errorKind error
212
212
}{
213
+ {input : "1B" , expect : 1 },
214
+ {input : "1b" , expect : 1 },
213
215
{input : "1" , expect : 1 },
214
216
{input : "1000" , expect : 1000 },
215
217
{input : "1K" , expect : 1024 },
216
218
{input : "1k" , expect : 1024 },
217
219
{input : "1KB" , expect : 1024 },
218
220
{input : "1KiB" , expect : 1024 },
219
221
{input : "1kb" , expect : 1024 },
222
+ {input : "1024B" , expect : 1024 },
223
+ {input : "1024b" , expect : 1024 },
220
224
{input : "1M" , expect : 1024 * 1024 },
221
225
{input : "1MB" , expect : 1024 * 1024 },
222
226
{input : "1MiB" , expect : 1024 * 1024 },
@@ -232,10 +236,10 @@ func TestParseStringAsBytes(t *testing.T) {
232
236
{input : "9223372036854775807" , expect : math .MaxInt64 },
233
237
{input : "9223372036854775807" , bits : 32 , error : true , errorKind : errBytesOutOfRangeString },
234
238
{input : "9223372036854775807" , bits : 12 , error : true , errorKind : errInvalidBitSize },
239
+ {input : "" , expect : - 1 },
235
240
{input : "-1" , expect : - 1 },
236
241
{input : "-10" , expect : - 1 },
237
242
{input : "-10GB" , expect : - 1 },
238
- {input : "1B" , error : true },
239
243
{input : "1FOO" , error : true },
240
244
{input : "FOO" , error : true },
241
245
}
0 commit comments