1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-10-24 15:12:55 +08:00
Files
kubo/test/sharness/t0150-clisuggest.sh
Shaun Bruce c175700dea Better error message on unrecognized command
Closes issue #1436

License: MIT
Signed-off-by: Shaun Bruce <shaun.m.bruce@gmail.com>
2015-07-28 09:20:53 -06:00

44 lines
764 B
Bash
Executable File

#!/bin/sh
test_description="Test ipfs cli cmd suggest"
. lib/test-lib.sh
test_suggest() {
test_expect_success "test command fails" '
test_must_fail ipfs kog 2>actual
'
test_expect_success "test one command is suggested" '
grep "Did you mean this?" actual &&
grep "log" actual ||
test_fsh cat actual
'
test_expect_success "test command fails" '
test_must_fail ipfs lis 2>actual
'
test_expect_success "test multiple commands are suggested" '
grep "Did you mean any of these?" actual &&
grep "ls" actual &&
grep "id" actual ||
test_fsh cat actual
'
}
test_init_ipfs
test_suggest
test_launch_ipfs_daemon
test_suggest
test_kill_ipfs_daemon
test_done