mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
22 lines
363 B
Go
22 lines
363 B
Go
package bytesutil
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestItoa(t *testing.T) {
|
|
f := func(n int, resultExpected string) {
|
|
t.Helper()
|
|
for range 5 {
|
|
result := Itoa(n)
|
|
if result != resultExpected {
|
|
t.Fatalf("unexpected result for Itoa(%d); got %q; want %q", n, result, resultExpected)
|
|
}
|
|
}
|
|
}
|
|
f(0, "0")
|
|
f(1, "1")
|
|
f(-123, "-123")
|
|
f(343432, "343432")
|
|
}
|