[#1344] pilorama: Use require.ErrorIs in tests

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-04-29 13:23:42 +03:00
parent dd7c4385c6
commit e2c88a9983

View file

@ -1,7 +1,6 @@
package pilorama package pilorama
import ( import (
"errors"
"math/rand" "math/rand"
"os" "os"
"path/filepath" "path/filepath"
@ -184,10 +183,10 @@ func testForestTreeAdd(t *testing.T, s Forest) {
t.Run("other trees are unaffected", func(t *testing.T) { t.Run("other trees are unaffected", func(t *testing.T) {
_, err := s.TreeGetByPath(cid, treeID+"123", AttributeFilename, []string{"file.txt"}, false) _, err := s.TreeGetByPath(cid, treeID+"123", AttributeFilename, []string{"file.txt"}, false)
require.True(t, errors.Is(err, ErrTreeNotFound), "got: %v", err) require.ErrorIs(t, err, ErrTreeNotFound)
_, err = s.TreeGetMeta(cid, treeID+"123", 0) _, err = s.TreeGetMeta(cid, treeID+"123", 0)
require.True(t, errors.Is(err, ErrTreeNotFound), "got: %v", err) require.ErrorIs(t, err, ErrTreeNotFound)
}) })
} }