frostfs-sdk-go/api/object/lock_test.go
Pavel Pogodaev 12ef42f496
Some checks failed
DCO / DCO (pull_request) Successful in 1m23s
Tests and linters / Tests (pull_request) Failing after 1m23s
Tests and linters / Lint (pull_request) Successful in 1m33s
[#276] Merge repo with frostfs-api-go
Signed-off-by: Pavel Pogodaev <p.pogodaev@yadro.com>
2024-10-12 12:15:53 +03:00

26 lines
500 B
Go

package object_test
import (
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/object"
objecttest "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/api/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)
}