mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 20:37:53 +08:00
Update the previous `invalid path` error to match the error returned from `SplitAbsPath`.
26 lines
540 B
Go
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)
|
|
}
|
|
|
|
}
|