-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
License: MIT Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
- Loading branch information
Showing
2 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,6 +163,30 @@ test_expect_success "'ipfs pin ls --type=all --quiet' is correct" ' | |
test_sort_cmp allpins_uniq_hashes actual_allpins | ||
' | ||
|
||
test_expect_success "'ipfs refs --unique' is correct" ' | ||
mkdir -p uniques && | ||
cd uniques && | ||
echo "content1" > file1 && | ||
echo "content1" > file2 && | ||
ROOT=$(ipfs add -r -q . | tail -n1) && | ||
ipfs refs --unique $ROOT >expected && | ||
ipfs add -q file1 >unique_hash && | ||
test_cmp expected unique_hash | ||
' | ||
|
||
test_expect_success "'ipfs refs --unique --recursive' is correct" ' | ||
mkdir -p a/b/c && | ||
echo "c1" > a/f1 && | ||
echo "c1" > a/b/f1 && | ||
echo "c1" > a/b/c/f1 && | ||
echo "c2" > a/b/c/f2 && | ||
ROOT=$(ipfs add -r -q a | tail -n1) && | ||
ipfs refs --unique --recursive $ROOT >refs_output && | ||
wc -l refs_output | sed "s/^ *//g" >line_count && | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gatesvp
Author
Contributor
|
||
echo "4 refs_output" >expected && | ||
test_cmp expected line_count | ||
' | ||
|
||
test_kill_ipfs_daemon | ||
|
||
test_done |
@gatesvp osx's
wc
adds whitespace... (oh coreutils) (i fixed it here)