MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestAckIndex

Function TestAckIndex

sqlchain/ackindex_test.go:28–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26)
27
28func TestAckIndex(t *testing.T) {
29 Convey("Given a ackIndex instance", t, func() {
30 var (
31 err error
32
33 ai = newAckIndex()
34 resp = &types.SignedResponseHeader{
35 ResponseHeader: types.ResponseHeader{
36 Request: types.RequestHeader{
37 NodeID: proto.NodeID(
38 "0000000000000000000000000000000000000000000000000000000000000000"),
39 ConnectionID: 0,
40 SeqNo: 0,
41 },
42 },
43 }
44 ack = &types.SignedAckHeader{
45 AckHeader: types.AckHeader{
46 Response: resp.ResponseHeader,
47 },
48 }
49 )
50 Convey("Add response and register ack should return no error", func() {
51 err = ai.addResponse(0, resp)
52 So(err, ShouldBeNil)
53 err = ai.register(0, ack)
54 So(err, ShouldBeNil)
55 err = ai.remove(0, ack)
56 So(err, ShouldBeNil)
57 })
58 })
59}

Callers

nothing calls this directly

Calls 5

NodeIDTypeAlias · 0.92
newAckIndexFunction · 0.85
addResponseMethod · 0.45
registerMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected