(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func TestDeprecatedJSON(t *testing.T) { |
| 94 | var buf bytes.Buffer |
| 95 | wc := newTestConn(nil, &buf, true) |
| 96 | rc := newTestConn(&buf, nil, false) |
| 97 | |
| 98 | var actual, expect struct { |
| 99 | A int |
| 100 | B string |
| 101 | } |
| 102 | expect.A = 1 |
| 103 | expect.B = "hello" |
| 104 | |
| 105 | if err := WriteJSON(wc, &expect); err != nil { |
| 106 | t.Fatal("write", err) |
| 107 | } |
| 108 | |
| 109 | if err := ReadJSON(rc, &actual); err != nil { |
| 110 | t.Fatal("read", err) |
| 111 | } |
| 112 | |
| 113 | if !reflect.DeepEqual(&actual, &expect) { |
| 114 | t.Fatal("equal", actual, expect) |
| 115 | } |
| 116 | } |
nothing calls this directly
no test coverage detected