MCPcopy Create free account
hub / github.com/Facets-cloud/flow / TestHumanInt

Function TestHumanInt

internal/app/stats_test.go:129–147  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

127}
128
129func TestHumanInt(t *testing.T) {
130 cases := []struct {
131 in int64
132 want string
133 }{
134 {0, "0"},
135 {999, "999"},
136 {1000, "1,000"},
137 {1234567, "1,234,567"},
138 {1041234, "1,041,234"},
139 {-1234567, "-1,234,567"},
140 }
141 for _, c := range cases {
142 got := humanInt(c.in)
143 if got != c.want {
144 t.Errorf("humanInt(%d) = %q, want %q", c.in, got, c.want)
145 }
146 }
147}
148
149func TestSparkline(t *testing.T) {
150 got := sparkline([]int{0, 5, 10})

Callers

nothing calls this directly

Calls 1

humanIntFunction · 0.85

Tested by

no test coverage detected