Skip to content

Commit

Permalink
test(snapshot): expand coverage tests for snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaOzen committed Dec 31, 2023
1 parent 0a1fb7f commit 54fcf4b
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions internal/storage/postgres/snapshot/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,51 @@ var _ = Describe("token", func() {
Expect(tt.target.Encode().String()).ShouldNot(Equal(tt.expected))
}
})

It("Case 3: Eg Success", func() {
tests := []struct {
token token.SnapToken
target token.SnapToken
}{
{NewToken(types.XID8{Uint: 4, Status: pgtype.Present}), NewToken(types.XID8{Uint: 4, Status: pgtype.Present})},
}

for _, tt := range tests {
Expect(tt.token.Eg(tt.target)).Should(BeTrue())
}
})

It("Case 4: Gt Success", func() {
tests := []struct {
token token.SnapToken
target token.SnapToken
}{
{
NewToken(types.XID8{Uint: 6, Status: pgtype.Present}),
NewToken(types.XID8{Uint: 4, Status: pgtype.Present}),
},
}

for _, tt := range tests {
Expect(tt.token.Gt(tt.target)).Should(BeTrue())
}
})

It("Case 5: Lt Success", func() {
tests := []struct {
token token.SnapToken
target token.SnapToken
}{
{
NewToken(types.XID8{Uint: 4, Status: pgtype.Present}),
NewToken(types.XID8{Uint: 6, Status: pgtype.Present}),
},
}

for _, tt := range tests {
Expect(tt.token.Lt(tt.target)).Should(BeTrue())
}
})
})

Context("Decode", func() {
Expand Down

0 comments on commit 54fcf4b

Please sign in to comment.