mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 03:47:45 +08:00
Add test to detect invalid path
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
parent
dfde18e124
commit
44245fe015
@ -24,4 +24,8 @@ func TestResolveNoComponents(t *testing.T) {
|
||||
t.Fatal("Should error with no components (/ipfs/).", err)
|
||||
}
|
||||
|
||||
_, err = core.Resolve(n.Context(), n, path.Path("/../.."))
|
||||
if err != path.ErrBadPath {
|
||||
t.Fatal("Should error with invalid path.", err)
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +112,12 @@ test_get_cmd() {
|
||||
test_cmp dir/b/c "$HASH2"/b/c &&
|
||||
rm -r "$HASH2"
|
||||
'
|
||||
|
||||
test_expect_success "ipfs get ../.. should fail" '
|
||||
echo "Error: invalid ipfs ref path" >expected &&
|
||||
test_must_fail ipfs get ../.. 2>actual &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
}
|
||||
|
||||
# should work offline
|
||||
|
||||
Loading…
Reference in New Issue
Block a user