MCPcopy
hub / github.com/apache/devlake / TestGetItemOutOfRange

Function TestGetItemOutOfRange

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

Source from the content-addressed store, hash-verified

66}
67
68func TestGetItemOutOfRange(t *testing.T) {
69 array := []any{1, 2, 3}
70
71 _, err := GetItem[int](array, 3)
72
73 assert.Error(t, err)
74 assert.Contains(t, err.Error(), "Index 3 out of range")
75}
76
77func TestConvertSlice(t *testing.T) {
78 value := []any{1, 2, 3}

Callers

nothing calls this directly

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected