use KiB etc. instead of KB

This commit is contained in:
Laytan Laats
2023-09-12 16:49:42 +02:00
parent 93caf5b311
commit 287beaff35
2 changed files with 18 additions and 18 deletions
+14 -14
View File
@@ -42,18 +42,18 @@ test_fmt_memory :: proc(t: ^testing.T) {
expect(t, got == exp, fmt.tprintf("(%q, %v): %q != %q", format, args, got, exp), loc)
}
check(t, "5b", "%m", 5)
check(t, "5B", "%M", 5)
check(t, "-5B", "%M", -5)
check(t, "3.00kb", "%m", mem.Kilobyte * 3)
check(t, "3kb", "%.0m", mem.Kilobyte * 3)
check(t, "3KB", "%.0M", mem.Kilobyte * 3)
check(t, "3.000 mb", "%#.3m", mem.Megabyte * 3)
check(t, "3.50 gb", "%#m", u32(mem.Gigabyte * 3.5))
check(t, "001tb", "%5.0m", mem.Terabyte)
check(t, "-01tb", "%5.0m", -mem.Terabyte)
check(t, "2.50 pb", "%#5.m", uint(mem.Petabyte * 2.5))
check(t, "1.00 EB", "%#M", mem.Exabyte)
check(t, "255 B", "%#M", u8(255))
check(t, "0b", "%m", u8(0))
check(t, "5b", "%m", 5)
check(t, "5B", "%M", 5)
check(t, "-5B", "%M", -5)
check(t, "3.00kib", "%m", mem.Kilobyte * 3)
check(t, "3kib", "%.0m", mem.Kilobyte * 3)
check(t, "3KiB", "%.0M", mem.Kilobyte * 3)
check(t, "3.000 mib", "%#.3m", mem.Megabyte * 3)
check(t, "3.50 gib", "%#m", u32(mem.Gigabyte * 3.5))
check(t, "01tib", "%5.0m", mem.Terabyte)
check(t, "-1tib", "%5.0m", -mem.Terabyte)
check(t, "2.50 pib", "%#5.m", uint(mem.Petabyte * 2.5))
check(t, "1.00 EiB", "%#M", mem.Exabyte)
check(t, "255 B", "%#M", u8(255))
check(t, "0b", "%m", u8(0))
}