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:
parent
589e2ad679
commit
ccd6cb46d2
1 changed files with 25 additions and 0 deletions
25
src/utils/json_test.go
Normal file
25
src/utils/json_test.go
Normal 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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue