frostfs-api-go/object/lock_test.go
Alex Vanin f69d2ad83c Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 13:42:36 +03:00

26 lines
498 B
Go

package object_test
import (
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object"
objecttest "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/object/test"
"github.com/stretchr/testify/require"
)
func TestLockRW(t *testing.T) {
var l object.Lock
var obj object.Object
require.Error(t, object.ReadLock(&l, obj))
l = *objecttest.GenerateLock(false)
object.WriteLock(&obj, l)
var l2 object.Lock
require.NoError(t, object.ReadLock(&l2, obj))
require.Equal(t, l, l2)
}