mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 11:31:54 +08:00

Reverts the changes that allowed small keys (ed25519 keys) to be inlined. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
32 lines
883 B
Go
32 lines
883 B
Go
package core_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
core "github.com/ipfs/go-ipfs/core"
|
|
coremock "github.com/ipfs/go-ipfs/core/mock"
|
|
path "gx/ipfs/QmZErC2Ay6WuGi96CPg316PwitdwgLo6RxZRqVjJjRj2MR/go-path"
|
|
)
|
|
|
|
func TestResolveNoComponents(t *testing.T) {
|
|
n, err := coremock.NewMockNode()
|
|
if n == nil || err != nil {
|
|
t.Fatal("Should have constructed a mock node", err)
|
|
}
|
|
|
|
_, err = core.Resolve(n.Context(), n.Namesys, n.Resolver, path.Path("/ipns/"))
|
|
if err != path.ErrNoComponents {
|
|
t.Fatal("Should error with no components (/ipns/).", err)
|
|
}
|
|
|
|
_, err = core.Resolve(n.Context(), n.Namesys, n.Resolver, path.Path("/ipfs/"))
|
|
if err != path.ErrNoComponents {
|
|
t.Fatal("Should error with no components (/ipfs/).", err)
|
|
}
|
|
|
|
_, err = core.Resolve(n.Context(), n.Namesys, n.Resolver, path.Path("/../.."))
|
|
if err != path.ErrBadPath {
|
|
t.Fatal("Should error with invalid path.", err)
|
|
}
|
|
}
|