Files
gocryptotrader/exchanges/orderbook/unsafe_test.go
Scott bf5a24b3d7 FTX: Fix incorrect partially-cancelled order assignment (#730)
* Fixed issues that led to incorrect partially-cancelled status

* Fixes all compatibleOrderVars args.Adds tests.Allow Offline fee testing

Co-authored-by: Mark Dzulko <mark@dzulko-clan.de>
2021-07-30 12:17:13 +10:00

29 lines
516 B
Go

package orderbook
import (
"testing"
"github.com/gofrs/uuid"
)
var unsafeID, _ = uuid.NewV4()
type externalBook struct{}
func (e *externalBook) Lock() {}
func (e *externalBook) Unlock() {}
func TestUnsafe(t *testing.T) {
d := newDepth(unsafeID)
ob := d.GetUnsafe()
if ob.AskHead == nil || ob.BidHead == nil || ob.m == nil {
t.Fatal("these items should not be nil")
}
ob2 := &externalBook{}
ob.Lock()
ob.Unlock() // nolint:staticcheck // Not needed in test
ob.LockWith(ob2)
ob.UnlockWith(ob2)
}