Skip to content

Commit a410f7e

Browse files
authored
Merge pull request #6116 from reinerRubin/test/cmds/6110-repo-stat-human-flag
command repo stat: add human flag tests to t0080-repo.sh
2 parents c0c6827 + 8b98cbe commit a410f7e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/sharness/t0080-repo.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ get_field_num() {
237237
test_expect_success "'ipfs repo stat' succeeds" '
238238
ipfs repo stat > repo-stats
239239
'
240+
240241
test_expect_success "repo stats came out correct" '
241242
grep "RepoPath" repo-stats &&
242243
grep "RepoSize" repo-stats &&
@@ -245,6 +246,19 @@ test_expect_success "repo stats came out correct" '
245246
grep "StorageMax" repo-stats
246247
'
247248

249+
test_expect_success "'ipfs repo stat --human' succeeds" '
250+
ipfs repo stat --human > repo-stats-human
251+
'
252+
253+
test_expect_success "repo stats --human came out correct" '
254+
grep "RepoPath" repo-stats-human &&
255+
grep -P "RepoSize:\s*([0-9]*[.])?[0-9]+\s+?(B|kB|MB|GB|TB|PB|EB)" repo-stats-human &&
256+
grep "NumObjects" repo-stats-human &&
257+
grep "Version" repo-stats-human &&
258+
grep -P "StorageMax:\s*([0-9]*[.])?[0-9]+\s+?(B|kB|MB|GB|TB|PB|EB)" repo-stats-human ||
259+
test_fsh cat repo-stats-human
260+
'
261+
248262
test_expect_success "'ipfs repo stat' after adding a file" '
249263
ipfs add repo-stats &&
250264
ipfs repo stat > repo-stats-2

0 commit comments

Comments
 (0)