update bytecount tests
package bytecount
-import "testing"
+import (
+ "testing"
-func TestFormat(t *testing.T) {
- if r := Format(615); r != "615 B" {
- t.Errorf("wrong format: was %s", r)
- }
-
- if r := Format(5623); r != "5.491 kiB" {
- t.Errorf("wrong format: was %s", r)
- }
-
- if r := Format(4425623); r != "4.221 MiB" {
- t.Errorf("wrong format: was %s", r)
- }
-
- if r := Format(9134426623); r != "8.507 GiB" {
- t.Errorf("wrong format: was %s", r)
- }
+ "github.com/stretchr/testify/assert"
+)
- if r := Format(4534425386623); r != "4.124 TiB" {
- t.Errorf("wrong format: was %s", r)
- }
+func TestFormat(t *testing.T) {
+ assert.Equal(t, Format(615), "615 B")
+ assert.Equal(t, Format(5623), "5.491 kiB")
+ assert.Equal(t, Format(4425623), "4.221 MiB")
+ assert.Equal(t, Format(9134426623), "8.507 GiB")
+ assert.Equal(t, Format(4534425386623), "4.124 TiB")
}
