MCPcopy Index your code
hub / github.com/apache/devlake / TestConvertSliceInvalidValue

Function TestConvertSliceInvalidValue

backend/core/utils/json_test.go:95–102  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestConvertSliceInvalidValue(t *testing.T) {
96 value := []any{1, "2", 3}
97
98 _, err := Convert[[]int](value)
99
100 assert.Error(t, err)
101 assert.Contains(t, err.Error(), "Element 1 is not of type int")
102}
103
104func TestConvertSliceInvalidSlice(t *testing.T) {
105 value := 1

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected