MCPcopy Create free account
hub / github.com/apache/kvrocks / decodeListLibResult

Function decodeListLibResult

tests/gocase/unit/scripting/function_test.go:76–98  ·  view source on GitHub ↗
(t *testing.T, v interface{})

Source from the content-addressed store, hash-verified

74}
75
76func decodeListLibResult(t *testing.T, v interface{}) ListLibResult {
77 switch res := v.(type) {
78 case []interface{}:
79 require.EqualValues(t, 6, len(res))
80 require.EqualValues(t, "library_name", res[0])
81 require.EqualValues(t, "engine", res[2])
82 require.EqualValues(t, "functions", res[4])
83 return ListLibResult{
84 Name: res[1].(string),
85 Engine: res[3].(string),
86 Functions: res[5].([]interface{}),
87 }
88 case map[interface{}]interface{}:
89 require.EqualValues(t, 3, len(res))
90 return ListLibResult{
91 Name: res["library_name"].(string),
92 Engine: res["engine"].(string),
93 Functions: res["functions"].([]interface{}),
94 }
95 }
96 require.Fail(t, "unexpected type")
97 return ListLibResult{}
98}
99
100func TestFunctions(t *testing.T) {
101 configOptions := []util.ConfigOptions{

Callers 1

function_test.goFile · 0.85

Calls 1

FailMethod · 0.80

Tested by

no test coverage detected