mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-20 02:21:48 +08:00
update add --chunker
test
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
This commit is contained in:
@ -156,15 +156,34 @@ test_add_cat_file() {
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker size-64 succeeds" '
|
||||
ipfs add --chunker=size-64 mountdir/hello.txt >actual
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker size-64 output looks good" '
|
||||
HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" &&
|
||||
echo "added $HASH hello.txt" >expected &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker=size-0 failed" '
|
||||
test_expect_code 1 ipfs add -Q --chunker=size-0 mountdir/hello.txt
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker rabin-36-512-1024 succeeds" '
|
||||
ipfs add -Q --chunker rabin-36-512-1024 mountdir/hello.txt
|
||||
ipfs add --chunker rabin-36-512-1024 mountdir/hello.txt >actual
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker rabin-36-512-1024 output looks good" '
|
||||
HASH="QmVr26fY1tKyspEJBniVhqxQeEjhF78XerGiqWAwraVLQH" &&
|
||||
echo "added $HASH hello.txt" >expected &&
|
||||
test_cmp expected actual
|
||||
'
|
||||
|
||||
test_expect_success "ipfs add --chunker rabin-12-512-1024 failed" '
|
||||
test_expect_code 1 ipfs add -Q --chunker rabin-12-512-1024 mountdir/hello.txt
|
||||
'
|
||||
|
||||
|
||||
test_expect_success "ipfs add on hidden file succeeds" '
|
||||
echo "Hello Worlds!" >mountdir/.hello.txt &&
|
||||
ipfs add mountdir/.hello.txt >actual
|
||||
|
Reference in New Issue
Block a user