Skip to content

Commit

Permalink
order: tests for fragment IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
Loong committed Jun 21, 2018
1 parent 75d615f commit e46ea5d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions order/fragment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ var _ = Describe("Order fragments", func() {
rhs, err := NewFragment(orderID, TypeLimit, ParityBuy, SettlementRenEx, expiry, tokens, price, maxVolume, minVolume, nonce)
Expect(err).ShouldNot(HaveOccurred())

Ω(bytes.Equal(lhs.ID[:], rhs.ID[:])).Should(Equal(true))
Ω(lhs.ID.Equal(rhs.ID)).Should(Equal(true))
Ω(lhs.ID.String()).Should(Equal(rhs.ID.String()))
Ω(lhs.Equal(&rhs)).Should(Equal(true))

})
Expand All @@ -104,9 +105,10 @@ var _ = Describe("Order fragments", func() {
copy(orderID[:], "newOrderID")

rhs, err := NewFragment(orderID, TypeLimit, ParityBuy, SettlementRenEx, time.Now(), tokens, price, maxVolume, minVolume, nonce)
Expect(err).ShouldNot(HaveOccurred())
Expect(err).ShouldNot(HaveOccurred())

Ω(bytes.Equal(lhs.ID[:], rhs.ID[:])).Should(Equal(false))
Ω(lhs.ID.Equal(rhs.ID)).Should(Equal(false))
Ω(lhs.ID.String()).ShouldNot(Equal(rhs.ID.String()))
Ω(lhs.Equal(&rhs)).Should(Equal(false))
})
})
Expand Down

0 comments on commit e46ea5d

Please sign in to comment.