1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-16 04:44:55 +02:00
antelope-api-healthcheck/internal/utils/json_test.go

22 lines
422 B
Go

package utils
import "testing"
func TestJson_GetInt64(t *testing.T) {
tests := []struct {
name string
input interface{}
want int64
}{
{"String", "test", 0},
{"Int", 1234, 0},
{"Float", float64(1234), 1234},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := JsonGetInt64(tt.input); got != tt.want {
t.Errorf("JsonGetInt64() = %v, want %v", got, tt.want)
}
})
}
}