kubo/core/pathresolver_test.go
Travis Person 2c71c54823 Named error for no components
Update the previous `invalid path` error to match the error returned
from `SplitAbsPath`.
2015-05-22 09:18:49 -07:00

26 lines
540 B
Go

package core
import (
"testing"
path "github.com/ipfs/go-ipfs/path"
)
func TestResolveNoComponents(t *testing.T) {
n, err := NewMockNode()
if n == nil || err != nil {
t.Fatal("Should have constructed a mock node", err)
}
_, err = Resolve(n.Context(), n, path.Path("/ipns/"))
if err != path.ErrNoComponents {
t.Fatal("Should error with no components (/ipns/).", err)
}
_, err = Resolve(n.Context(), n, path.Path("/ipfs/"))
if err != path.ErrNoComponents {
t.Fatal("Should error with no components (/ipfs/).", err)
}
}