Use testify

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
This commit is contained in:
Maksym Pavlenko
2022-04-01 18:17:58 -07:00
parent 9766107a53
commit 871b6b6a9f
30 changed files with 356 additions and 362 deletions

View File

@@ -19,14 +19,16 @@ package local
import (
"testing"
"gotest.tools/v3/assert"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestTryLock(t *testing.T) {
err := tryLock("testref")
assert.NilError(t, err)
assert.NoError(t, err)
defer unlock("testref")
err = tryLock("testref")
assert.ErrorContains(t, err, "ref testref locked for ")
require.NotNil(t, err)
assert.Contains(t, err.Error(), "ref testref locked for ")
}