bbgo: add test Test_isNewerUpdate

This commit is contained in:
c9s 2023-11-22 17:37:10 +08:00
parent 8f5f5dfeed
commit 8afd3c9ee1
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -64,3 +64,16 @@ func TestActiveOrderBook_pendingOrders(t *testing.T) {
assert.True(t, filled, "filled event should be fired")
}
func Test_isNewerUpdate(t *testing.T) {
a := types.Order{
Status: types.OrderStatusPartiallyFilled,
ExecutedQuantity: number(0.2),
}
b := types.Order{
Status: types.OrderStatusPartiallyFilled,
ExecutedQuantity: number(0.1),
}
ret := isNewerUpdate(a, b)
assert.True(t, ret)
}