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

Adding src/api/log_params_test.go

This commit is contained in:
Henrik Hautakoski 2022-08-17 16:55:22 +02:00
parent a550f67dca
commit 816a38acae
No known key found for this signature in database
GPG key ID: 608414D93E862CCD

View file

@ -0,0 +1,34 @@
package api
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestLogParams(t *testing.T) {
type test_struct struct {
First string
Second int
}
p := LogParams{}
p.Add("one", 1)
p.Add("string", "str")
p.Add("struct", test_struct{First:"first_string",Second:1234})
expected := []interface{}([]interface {}{
"one",1,
"string","str",
"struct",test_struct{
First:"first_string",
Second:1234,
},
})
assert.Equal(t, expected, p.ToSlice())
}