(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestDecodingControlRecords(t *testing.T) { |
| 51 | abortTx := testDecode(t, "abort transaction", abortTxCtrlRecKey, abortTxCtrlRecValue) |
| 52 | |
| 53 | assertRecordType(t, &abortTx, ControlRecordAbort) |
| 54 | |
| 55 | if abortTx.CoordinatorEpoch != 10 { |
| 56 | t.Errorf("abort tx control record coordinator epoch mismatch") |
| 57 | } |
| 58 | |
| 59 | commitTx := testDecode(t, "commit transaction", commitTxCtrlRecKey, commitTxCtrlRecValue) |
| 60 | |
| 61 | if commitTx.CoordinatorEpoch != 15 { |
| 62 | t.Errorf("commit tx control record coordinator epoch mismatch") |
| 63 | } |
| 64 | assertRecordType(t, &commitTx, ControlRecordCommit) |
| 65 | |
| 66 | unknown := testDecode(t, "unknown", unknownCtrlRecKey, unknownCtrlRecValue) |
| 67 | |
| 68 | assertRecordType(t, &unknown, ControlRecordUnknown) |
| 69 | } |
nothing calls this directly
no test coverage detected