@@ -52,18 +52,18 @@ func TestMetric(t *testing.T) {
5252 {12345678900000000000 , "12346" , "Pcd" }, // Not ideal, but ok
5353 {0xffffffffffffffff , "18447" , "Pcd" }, // Not ideal, but ok
5454 } {
55- number , unit := counts .Metric .Format (ht .n , "cd" )
55+ number , unit := counts .Metric .FormatNumber (ht .n , "cd" )
5656 assert .Equalf (ht .number , number , "Number for %d in metric" , ht .n )
5757 assert .Equalf (ht .unit , unit , "Unit for %d in metric" , ht .n )
5858 if ht .n < 0xffffffff {
5959 c := counts .NewCount32 (ht .n )
60- number , unit := c . Human ( counts .Metric , "cd" )
60+ number , unit := counts .Metric . Format ( c , "cd" )
6161 assert .Equalf (ht .number , number , "Number for Count32(%d) in metric" , ht .n )
6262 assert .Equalf (ht .unit , unit , "Unit for Count32(%d) in metric" , ht .n )
6363 }
6464 if ht .n < 0xffffffffffffffff {
6565 c := counts .NewCount64 (ht .n )
66- number , unit := c . Human ( counts .Metric , "cd" )
66+ number , unit := counts .Metric . Format ( c , "cd" )
6767 assert .Equalf (ht .number , number , "Number for Count64(%d) in metric" , ht .n )
6868 assert .Equalf (ht .unit , unit , "Unit for Count64(%d) in metric" , ht .n )
6969 }
@@ -91,18 +91,18 @@ func TestBinary(t *testing.T) {
9191 {1152921504606846976 , "1024" , "PiB" },
9292 {0xffffffffffffffff , "16384" , "PiB" },
9393 } {
94- number , unit := counts .Binary .Format (ht .n , "B" )
94+ number , unit := counts .Binary .FormatNumber (ht .n , "B" )
9595 assert .Equalf (ht .number , number , "Number for %d in binary" , ht .n )
9696 assert .Equalf (ht .unit , unit , "Unit for %d in binary" , ht .n )
9797 if ht .n < 0xffffffff {
9898 c := counts .NewCount32 (ht .n )
99- number , unit := c . Human ( counts .Binary , "B" )
99+ number , unit := counts .Binary . Format ( c , "B" )
100100 assert .Equalf (ht .number , number , "Number for Count32(%d) in binary" , ht .n )
101101 assert .Equalf (ht .unit , unit , "Unit for Count32(%d) in binary" , ht .n )
102102 }
103103 if ht .n < 0xffffffffffffffff {
104104 c := counts .NewCount64 (ht .n )
105- number , unit := c . Human ( counts .Binary , "B" )
105+ number , unit := counts .Binary . Format ( c , "B" )
106106 assert .Equalf (ht .number , number , "Number for Count64(%d) in binary" , ht .n )
107107 assert .Equalf (ht .unit , unit , "Unit for Count64(%d) in binary" , ht .n )
108108 }
@@ -113,7 +113,7 @@ func TestLimits32(t *testing.T) {
113113 assert := assert .New (t )
114114
115115 c := counts .NewCount32 (0xffffffff )
116- number , unit := c . Human ( counts .Metric , "cd" )
116+ number , unit := counts .Metric . Format ( c , "cd" )
117117 assert .Equalf ("∞" , number , "Number for Count32(0xffffffff) in metric" )
118118 assert .Equalf ("cd" , unit , "Unit for Count32(0xffffffff) in metric" )
119119}
@@ -122,7 +122,7 @@ func TestLimits64(t *testing.T) {
122122 assert := assert .New (t )
123123
124124 c := counts .NewCount64 (0xffffffffffffffff )
125- number , unit := c . Human ( counts .Metric , "B" )
125+ number , unit := counts .Metric . Format ( c , "B" )
126126 assert .Equalf ("∞" , number , "Number for Count64(0xffffffffffffffff) in metric" )
127127 assert .Equalf ("B" , unit , "Unit for Count64(0xffffffffffffffff) in metric" )
128128}
0 commit comments