@@ -52,18 +52,18 @@ func TestMetric(t *testing.T) {
52
52
{12345678900000000000 , "12346" , "Pcd" }, // Not ideal, but ok
53
53
{0xffffffffffffffff , "18447" , "Pcd" }, // Not ideal, but ok
54
54
} {
55
- number , unit := counts .Metric .Format (ht .n , "cd" )
55
+ number , unit := counts .Metric .FormatNumber (ht .n , "cd" )
56
56
assert .Equalf (ht .number , number , "Number for %d in metric" , ht .n )
57
57
assert .Equalf (ht .unit , unit , "Unit for %d in metric" , ht .n )
58
58
if ht .n < 0xffffffff {
59
59
c := counts .NewCount32 (ht .n )
60
- number , unit := c . Human ( counts .Metric , "cd" )
60
+ number , unit := counts .Metric . Format ( c , "cd" )
61
61
assert .Equalf (ht .number , number , "Number for Count32(%d) in metric" , ht .n )
62
62
assert .Equalf (ht .unit , unit , "Unit for Count32(%d) in metric" , ht .n )
63
63
}
64
64
if ht .n < 0xffffffffffffffff {
65
65
c := counts .NewCount64 (ht .n )
66
- number , unit := c . Human ( counts .Metric , "cd" )
66
+ number , unit := counts .Metric . Format ( c , "cd" )
67
67
assert .Equalf (ht .number , number , "Number for Count64(%d) in metric" , ht .n )
68
68
assert .Equalf (ht .unit , unit , "Unit for Count64(%d) in metric" , ht .n )
69
69
}
@@ -91,18 +91,18 @@ func TestBinary(t *testing.T) {
91
91
{1152921504606846976 , "1024" , "PiB" },
92
92
{0xffffffffffffffff , "16384" , "PiB" },
93
93
} {
94
- number , unit := counts .Binary .Format (ht .n , "B" )
94
+ number , unit := counts .Binary .FormatNumber (ht .n , "B" )
95
95
assert .Equalf (ht .number , number , "Number for %d in binary" , ht .n )
96
96
assert .Equalf (ht .unit , unit , "Unit for %d in binary" , ht .n )
97
97
if ht .n < 0xffffffff {
98
98
c := counts .NewCount32 (ht .n )
99
- number , unit := c . Human ( counts .Binary , "B" )
99
+ number , unit := counts .Binary . Format ( c , "B" )
100
100
assert .Equalf (ht .number , number , "Number for Count32(%d) in binary" , ht .n )
101
101
assert .Equalf (ht .unit , unit , "Unit for Count32(%d) in binary" , ht .n )
102
102
}
103
103
if ht .n < 0xffffffffffffffff {
104
104
c := counts .NewCount64 (ht .n )
105
- number , unit := c . Human ( counts .Binary , "B" )
105
+ number , unit := counts .Binary . Format ( c , "B" )
106
106
assert .Equalf (ht .number , number , "Number for Count64(%d) in binary" , ht .n )
107
107
assert .Equalf (ht .unit , unit , "Unit for Count64(%d) in binary" , ht .n )
108
108
}
@@ -113,7 +113,7 @@ func TestLimits32(t *testing.T) {
113
113
assert := assert .New (t )
114
114
115
115
c := counts .NewCount32 (0xffffffff )
116
- number , unit := c . Human ( counts .Metric , "cd" )
116
+ number , unit := counts .Metric . Format ( c , "cd" )
117
117
assert .Equalf ("∞" , number , "Number for Count32(0xffffffff) in metric" )
118
118
assert .Equalf ("cd" , unit , "Unit for Count32(0xffffffff) in metric" )
119
119
}
@@ -122,7 +122,7 @@ func TestLimits64(t *testing.T) {
122
122
assert := assert .New (t )
123
123
124
124
c := counts .NewCount64 (0xffffffffffffffff )
125
- number , unit := c . Human ( counts .Metric , "B" )
125
+ number , unit := counts .Metric . Format ( c , "B" )
126
126
assert .Equalf ("∞" , number , "Number for Count64(0xffffffffffffffff) in metric" )
127
127
assert .Equalf ("B" , unit , "Unit for Count64(0xffffffffffffffff) in metric" )
128
128
}
0 commit comments