Commit 44245fe0 authored by rht's avatar rht

Add test to detect invalid path

License: MIT
Signed-off-by: default avatarrht <rhtbot@gmail.com>
parent dfde18e1
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment