(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func 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 | |
| 111 | func TestDecode(t *testing.T) { |
| 112 | var format sheets.CellFormat |
nothing calls this directly
no test coverage detected