aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/tool_test.go
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2020-02-03 21:50:37 +0200
committerGitHub <noreply@github.com>2020-02-03 21:50:37 +0200
commit20c513be6e376231a33f01625f5ae747d2051241 (patch)
treee44d44973999a7acede7fc3e6a29306064b5df18 /modules/base/tool_test.go
parentea50f60df231ba75c32d03118e0c8af17c325324 (diff)
downloadgitea-20c513be6e376231a33f01625f5ae747d2051241.tar.gz
gitea-20c513be6e376231a33f01625f5ae747d2051241.zip
Show download count info in release list (#10124)
* Show download count info in release list * Use go-humanize
Diffstat (limited to 'modules/base/tool_test.go')
-rw-r--r--modules/base/tool_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go
index 3aa86c5cbf..075b5ed817 100644
--- a/modules/base/tool_test.go
+++ b/modules/base/tool_test.go
@@ -103,19 +103,19 @@ func TestAvatarLink(t *testing.T) {
func TestFileSize(t *testing.T) {
var size int64 = 512
- assert.Equal(t, "512B", FileSize(size))
+ assert.Equal(t, "512 B", FileSize(size))
size *= 1024
- assert.Equal(t, "512KB", FileSize(size))
+ assert.Equal(t, "512 KiB", FileSize(size))
size *= 1024
- assert.Equal(t, "512MB", FileSize(size))
+ assert.Equal(t, "512 MiB", FileSize(size))
size *= 1024
- assert.Equal(t, "512GB", FileSize(size))
+ assert.Equal(t, "512 GiB", FileSize(size))
size *= 1024
- assert.Equal(t, "512TB", FileSize(size))
+ assert.Equal(t, "512 TiB", FileSize(size))
size *= 1024
- assert.Equal(t, "512PB", FileSize(size))
+ assert.Equal(t, "512 PiB", FileSize(size))
size *= 4
- assert.Equal(t, "2.0EB", FileSize(size))
+ assert.Equal(t, "2.0 EiB", FileSize(size))
}
func TestSubtract(t *testing.T) {