MCPcopy Create free account
hub / github.com/openclaw/gogcli / TestInferMask

Function TestInferMask

internal/sheetsformat/format_test.go:86–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestInferMask(t *testing.T) {
87 normalized, paths, err := InferMask(
88 []byte(`{"backgroundColor":{"red":0,"green":0.5,"blue":1},"textFormat":{"bold":false}}`),
89 )
90 if err != nil {
91 t.Fatalf("InferMask() error = %v", err)
92 }
93
94 want := "userEnteredFormat.backgroundColor.blue,userEnteredFormat.backgroundColor.green,userEnteredFormat.backgroundColor.red,userEnteredFormat.textFormat.bold"
95 if normalized != want {
96 t.Fatalf("normalized = %q, want %q", normalized, want)
97 }
98
99 wantPaths := []string{"backgroundColor.blue", "backgroundColor.green", "backgroundColor.red", "textFormat.bold"}
100 if len(paths) != len(wantPaths) {
101 t.Fatalf("paths = %#v, want %#v", paths, wantPaths)
102 }
103
104 for i := range wantPaths {
105 if paths[i] != wantPaths[i] {
106 t.Fatalf("paths = %#v, want %#v", paths, wantPaths)
107 }
108 }
109}
110
111func TestDecode(t *testing.T) {
112 var format sheets.CellFormat

Callers

nothing calls this directly

Calls 1

InferMaskFunction · 0.85

Tested by

no test coverage detected