diff options
| author | bingoohuang <bingoo.huang@gmail.com> | 2021-04-27 10:37:24 +0800 |
|---|---|---|
| committer | bingoohuang <bingoo.huang@gmail.com> | 2021-04-27 10:37:24 +0800 |
| commit | cf552417a7a422d1313c53972fd1175684e758e0 (patch) | |
| tree | 621d6f4f432cefe75c455939e084193eb7462001 /weed/util/bytes_test.go | |
| parent | 31f1cdeac281fb88a3d03743f9796f81e1d74378 (diff) | |
| download | seaweedfs-cf552417a7a422d1313c53972fd1175684e758e0.tar.xz seaweedfs-cf552417a7a422d1313c53972fd1175684e758e0.zip | |
minFreeSpace refactored
Diffstat (limited to 'weed/util/bytes_test.go')
| -rw-r--r-- | weed/util/bytes_test.go | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/weed/util/bytes_test.go b/weed/util/bytes_test.go index 4a9c25e52..d9269cadb 100644 --- a/weed/util/bytes_test.go +++ b/weed/util/bytes_test.go @@ -2,32 +2,6 @@ package util import "testing" -func TestParseMinFreeSpace(t *testing.T) { - tests := []struct { - in string - ok bool - value float32 - }{ - {in: "42", ok: true, value: 42}, - {in: "-1", ok: false, value: 0}, - {in: "101", ok: false, value: 0}, - {in: "100B", ok: false, value: 0}, - {in: "100Ki", ok: true, value: 100 * 1024}, - {in: "100GiB", ok: true, value: 100 * 1024 * 1024 * 1024}, - {in: "42M", ok: true, value: 42 * 1000 * 1000}, - } - - for _, p := range tests { - got, err := ParseMinFreeSpace(p.in) - if p.ok != (err == nil) { - t.Errorf("failed to test %v", p.in) - } - if p.ok && err == nil && got != p.value { - t.Errorf("failed to test %v", p.in) - } - } -} - func TestByteParsing(t *testing.T) { tests := []struct { in string |
