Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
package mathUtil
import (
"testing"
)
func TestGetSizeDesc(t *testing.T) {
var size int64
var expectedStr string
var finalStr string
size = 1
expectedStr = "1B"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1KB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1MB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1.00GB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1.00TB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1.00PB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
size *= 1024
expectedStr = "1.00EB"
finalStr = GetSizeDesc(size)
if finalStr != expectedStr {
t.Errorf("Expected %s, but got %s", expectedStr, finalStr)
}
}