(t *testing.T)
| 130 | } |
| 131 | |
| 132 | func TestMarshalerEscaping(t *testing.T) { |
| 133 | var c C |
| 134 | want := `"\u003c\u0026\u003e"` |
| 135 | b, err := json.Marshal(c) |
| 136 | if err != nil { |
| 137 | t.Fatalf("Marshal(c): %v", err) |
| 138 | } |
| 139 | if got := string(b); got != want { |
| 140 | t.Errorf("Marshal(c) = %#q, want %#q", got, want) |
| 141 | } |
| 142 | |
| 143 | var ct CText |
| 144 | want = `"\"\u003c\u0026\u003e\""` |
| 145 | b, err = json.Marshal(ct) |
| 146 | if err != nil { |
| 147 | t.Fatalf("Marshal(ct): %v", err) |
| 148 | } |
| 149 | if got := string(b); got != want { |
| 150 | t.Errorf("Marshal(ct) = %#q, want %#q", got, want) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func TestAnonymousNonstruct(t *testing.T) { |
| 155 | var i IntType = 11 |
nothing calls this directly
no test coverage detected
searching dependent graphs…