Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
727aea1f
提交
727aea1f
authored
1月 07, 2019
作者:
Kevin Atkinson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Enhance ipfs add --cid-base32 tests.
License: MIT Signed-off-by:
Kevin Atkinson
<
k@kevina.org
>
上级
57457af7
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
40 行增加
和
12 行删除
+40
-12
t0040-add-and-cat.sh
test/sharness/t0040-add-and-cat.sh
+40
-12
没有找到文件。
test/sharness/t0040-add-and-cat.sh
浏览文件 @
727aea1f
...
...
@@ -276,32 +276,55 @@ test_add_cat_file() {
# --cid-base=base32
test_expect_success
"ipfs add --cid-base=base32 succeeds"
'
echo "
Hello Worlds!" >mountdir/hello
.txt &&
ipfs add --cid-base=base32 mountdir/
hello
.txt >actual
echo "
base32 test" >mountdir/base32-test
.txt &&
ipfs add --cid-base=base32 mountdir/
base32-test
.txt >actual
'
test_expect_success
"ipfs add output looks good"
'
HASH="bafybeidpq7lcjx4w5c6yr4vuthzvlav54hgxsremwk73to5ferdc2rxhai" &&
echo "added $HASH hello.txt" >expected &&
test_expect_success
"ipfs add --cid-base=base32 output looks good"
'
HASHb32="bafybeibyosqxljd2eptb4ebbtvk7pb4aoxzqa6ttdsflty6rsslz5y6i34" &&
echo "added $HASHb32 base32-test.txt" >expected &&
test_cmp expected actual
'
test_expect_success
"ipfs add --cid-base=base32 --only-hash succeeds"
'
ipfs add --cid-base=base32 --only-hash mountdir/hello.txt > oh_actual
ipfs add --cid-base=base32 --only-hash mountdir/base32-test.txt > oh_actual
'
test_expect_success
"ipfs add --cid-base=base32 --only-hash output looks good"
'
test_cmp expected oh_actual
'
test_expect_success
"ipfs add --only-hash output looks good"
'
test_expect_success
"ipfs add --cid-base=base32 --force-cid-base=false succeeds"
'
echo "base32 test" >mountdir/base32-test.txt &&
ipfs add --cid-base=base32 --force-cid-base=false mountdir/base32-test.txt >actual
'
test_expect_success
"ipfs add --cid-base=base32 --force-cid-base=false output looks good"
'
HASHv0=$(cid-fmt -v 0 -b z %s "$HASHb32") &&
echo "added $HASHv0 base32-test.txt" >expected &&
test_cmp expected actual
'
test_expect_success
"ipfs add --cid-base=base32 --force-cid-base=false --only-hash succeeds"
'
ipfs add --cid-base=base32 --force-cid-base=false --only-hash mountdir/base32-test.txt > oh_actual
'
test_expect_success
"ipfs add --cid-base=base32 --force-cid-base=false --only-hash output looks good"
'
test_cmp expected oh_actual
'
test_expect_success
"ipfs cat succeeds"
'
ipfs cat "$HASH" >actual
test_expect_success
"ipfs cat with base32 hash succeeds"
'
ipfs cat "$HASHb32" >actual
'
test_expect_success
"ipfs cat with base32 hash output looks good"
'
echo "base32 test" >expected &&
test_cmp expected actual
'
test_expect_success
"ipfs cat output looks good"
'
echo "Hello Worlds!" >expected &&
test_expect_success
"ipfs cat using CIDv0 hash succeeds"
'
ipfs cat "$HASHv0" >actual
'
test_expect_success
"ipfs cat using CIDv0 hash looks good"
'
echo "base32 test" >expected &&
test_cmp expected actual
'
}
test_add_cat_5MB
()
{
...
...
@@ -343,6 +366,11 @@ test_add_cat_5MB() {
test_cmp mountdir/bigfile actual
'
test_expect_success
"remove hash"
'
ipfs pin rm "$EXP_HASH" &&
ipfs block rm "$EXP_HASH"
'
test_expect_success
"get base32 version of CID"
'
ipfs cid base32 $EXP_HASH > base32_cid &&
BASE32_HASH=`cat base32_cid`
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论