(t *testing.T)
| 217 | } |
| 218 | |
| 219 | func TestRevTreeUnmarshalOldFormat(t *testing.T) { |
| 220 | // 'channels' is an old revtree property that stored channel history for previous revisions. |
| 221 | // we moved non-winning leaf revision channel information into a 'channelMap' property instead to handle the case where documents are in conflict. |
| 222 | // bodies is an old revtree property that stored full bodies for previous revisions. |
| 223 | // we moved this into bodyMap for inline bodies and bodyKeyMap for externally stored bodies. |
| 224 | const testJSON = `{ |
| 225 | "revs": ["3-three", "2-two", "1-one"], |
| 226 | "parents": [1, 2, -1], |
| 227 | "bodies": ["{\"foo\":\"bar\"}", "", ""], |
| 228 | "channels": [["ABC", "CBS"], null, ["ABC"]] |
| 229 | }` |
| 230 | expected := testmap.copy() |
| 231 | |
| 232 | // winning rev channel information no longer present in revtree, |
| 233 | // expect to drop it at unmarshal time if it's still in the raw JSON |
| 234 | ri, err := expected.getInfo("3-three") |
| 235 | require.NoError(t, err) |
| 236 | ri.Channels = nil |
| 237 | |
| 238 | assertRevTreeUnmarshal(t, testJSON, expected) |
| 239 | } |
| 240 | |
| 241 | func TestRevTreeUnmarshalOldFormatNonWinningRev(t *testing.T) { |
| 242 | // we moved non-winning leaf revision channel information into a 'channelMap' property instead to handle the case where documents are in conflict. |
nothing calls this directly
no test coverage detected