diff --git a/src/api/log_params_test.go b/src/api/log_params_test.go new file mode 100644 index 0000000..4eb27b0 --- /dev/null +++ b/src/api/log_params_test.go @@ -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()) +}