1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#!/bin/sh
set -e
# Test 1: --help exits successfully and mentions the tool name
echo "Test: ckon --help"
output=$(ckon --help 2>&1)
echo "$output" | grep -q "ckon"
echo "PASS: --help produced expected output"
# Test 2: --version exits successfully and prints a non-empty version string
echo "Test: ckon --version"
version=$(ckon --version 2>&1)
test -n "$version"
echo "PASS: --version printed '$version'"
# Test 3: running ckon without setup prints an actionable message
echo "Test: ckon without setup"
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"
output=$(ckon 2>&1) || true
echo "$output" | grep -q "ckon setup"
echo "PASS: missing-setup message contains 'ckon setup'"
|