mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-18 23:16:49 +00:00
* 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>
29 lines
516 B
Go
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)
|
|
}
|