github.com/iikira/iikira-go-utils@v0.0.0-20230610031953-f2cb11cde33a/utils/converter/size_test.go (about) 1 package converter_test 2 3 import ( 4 "fmt" 5 "github.com/iikira/iikira-go-utils/utils/converter" 6 "testing" 7 ) 8 9 func TestParseFileSizeStr(t *testing.T) { 10 for _, v := range []string{"1k", "3.86mb", "4.001Gb", "32"} { 11 size, err := converter.ParseFileSizeStr(v) 12 if err != nil { 13 t.Fatalf("%s\n", err) 14 } 15 fmt.Println(v, size) 16 } 17 }