github.com/argoproj/argo-events@v1.9.1/common/json_test.go (about) 1 package common 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func TestMustJson(t *testing.T) { 10 assert.Equal(t, "1", MustJSON(1)) 11 } 12 13 func TestUnJSON(t *testing.T) { 14 var in int 15 MustUnJSON("1", &in) 16 assert.Equal(t, 1, in) 17 }