diff --git a/pkg/types/position_test.go b/pkg/types/position_test.go index 0b9b98320..6e7b6c747 100644 --- a/pkg/types/position_test.go +++ b/pkg/types/position_test.go @@ -313,3 +313,15 @@ func TestPosition(t *testing.T) { }) } } + +func TestPosition_SetClosing(t *testing.T) { + p := NewPosition("BTCUSDT", "BTC", "USDT") + ret := p.SetClosing(true) + assert.True(t, ret) + + ret = p.SetClosing(true) + assert.False(t, ret) + + ret = p.SetClosing(false) + assert.True(t, ret) +}