aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index ec9bc1eb52..fa61e5dfb1 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -287,20 +287,19 @@ func TestHtmlTimeSince(t *testing.T) {
}
func TestFileSize(t *testing.T) {
- var size int64
- size = 512
+ var size int64 = 512
assert.Equal(t, "512B", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512KB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512MB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512GB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512TB", FileSize(size))
- size = size * 1024
+ size *= 1024
assert.Equal(t, "512PB", FileSize(size))
- size = size * 4
+ size *= 4
assert.Equal(t, "2.0EB", FileSize(size))
}