Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
44245fe0
Commit
44245fe0
authored
9 years ago
by
rht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to detect invalid path
License: MIT Signed-off-by:
rht
<
rhtbot@gmail.com
>
parent
dfde18e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
core/pathresolver_test.go
core/pathresolver_test.go
+4
-0
test/sharness/t0090-get.sh
test/sharness/t0090-get.sh
+6
-0
No files found.
core/pathresolver_test.go
View file @
44245fe0
...
...
@@ -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
)
}
}
This diff is collapsed.
Click to expand it.
test/sharness/t0090-get.sh
View file @
44245fe0
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment