提交 8b98cbe0 作者: tg

command repo stat: add human flag tests to t0080-repo.sh

License: MIT
Signed-off-by: 's avatarGeorgij Tolstov <tolstov.georgij@gmail.com>
上级 c0c68278
......@@ -237,6 +237,7 @@ get_field_num() {
test_expect_success "'ipfs repo stat' succeeds" '
ipfs repo stat > repo-stats
'
test_expect_success "repo stats came out correct" '
grep "RepoPath" repo-stats &&
grep "RepoSize" repo-stats &&
......@@ -245,6 +246,19 @@ test_expect_success "repo stats came out correct" '
grep "StorageMax" repo-stats
'
test_expect_success "'ipfs repo stat --human' succeeds" '
ipfs repo stat --human > repo-stats-human
'
test_expect_success "repo stats --human came out correct" '
grep "RepoPath" repo-stats-human &&
grep -P "RepoSize:\s*([0-9]*[.])?[0-9]+\s+?(B|kB|MB|GB|TB|PB|EB)" repo-stats-human &&
grep "NumObjects" repo-stats-human &&
grep "Version" repo-stats-human &&
grep -P "StorageMax:\s*([0-9]*[.])?[0-9]+\s+?(B|kB|MB|GB|TB|PB|EB)" repo-stats-human ||
test_fsh cat repo-stats-human
'
test_expect_success "'ipfs repo stat' after adding a file" '
ipfs add repo-stats &&
ipfs repo stat > repo-stats-2
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论