func TestJvInvalidWithMessage_string(t *testing.T) { is := is.New(t) jv := jq.JvInvalidWithMessage(jq.JvFromString("Error message 1")) is.False(jv.IsValid()) msg := jv.Copy().GetInvalidMessage() is.Equal(msg.Kind(), jq.JV_KIND_STRING) msg.Free() str, ok := jv.GetInvalidMessageAsString() is.True(ok) is.Equal("Error message 1", str) }
func TestJvInvalidWithMessage_object(t *testing.T) { is := is.New(t) jv := jq.JvInvalidWithMessage(jq.JvObject()) is.False(jv.IsValid()) msg := jv.Copy().GetInvalidMessage() is.Equal(msg.Kind(), jq.JV_KIND_OBJECT) msg.Free() str, ok := jv.GetInvalidMessageAsString() is.True(ok) is.Equal("{}", str) }