1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-api-healthcheck synced 2026-06-17 04:50:02 +02:00

Adding src/utils/json_test.go

This commit is contained in:
Henrik Hautakoski 2022-08-16 20:05:31 +02:00
parent 589e2ad679
commit ccd6cb46d2
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

25
src/utils/json_test.go Normal file
View file

@ -0,0 +1,25 @@
package utils
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestJsonGetInt64WithString(t *testing.T) {
n := JsonGetInt64("test")
assert.Equal(t, int64(0), n)
}
func TestJsonGetInt64WithInt(t *testing.T) {
n := JsonGetInt64(1234)
assert.Equal(t, int64(0), n)
}
func TestJsonGetInt64WithFloat64(t *testing.T) {
n := JsonGetInt64(float64(1234))
assert.Equal(t, int64(1234), n)
}