MCPcopy Create free account
hub / github.com/alibaba/open-code-review / assertJSONValue

Function assertJSONValue

cmd/opencodereview/config_cmd_test.go:1743–1759  ·  view source on GitHub ↗
(t *testing.T, root map[string]any, path []string, want any)

Source from the content-addressed store, hash-verified

1741}
1742
1743func assertJSONValue(t *testing.T, root map[string]any, path []string, want any) {
1744 t.Helper()
1745 var current any = root
1746 for _, part := range path {
1747 object, ok := current.(map[string]any)
1748 if !ok {
1749 t.Fatalf("JSON path %q entered %T at %q", strings.Join(path, "."), current, part)
1750 }
1751 current, ok = object[part]
1752 if !ok {
1753 t.Fatalf("JSON path %q is missing", strings.Join(path, "."))
1754 }
1755 }
1756 if !reflect.DeepEqual(current, want) {
1757 t.Errorf("JSON path %q = %#v, want %#v", strings.Join(path, "."), current, want)
1758 }
1759}
1760
1761func TestSetMCPServerValue_Type(t *testing.T) {
1762 cfg := &Config{}

Calls

no outgoing calls

Tested by

no test coverage detected