mirror of
https://github.com/ipfs/kubo.git
synced 2025-10-24 15:12:55 +08:00
44 lines
764 B
Bash
Executable File
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
|