commit e3a46353dce2f604254675a385e8871bee794d32 from: Stefan Sperling date: Tue Sep 14 16:37:50 2021 UTC verify that 'got status -s' and 'got status -S' cannot be used together commit - 4f3c844beaeb6a0b30565833e0481b8de9a5106e commit + e3a46353dce2f604254675a385e8871bee794d32 blob - 77a893caaab771d9316277cdf751daf903d8707f blob + 47f3fb72e870ae3ea6d9b9aa4148243c8f217315 --- regress/cmdline/status.sh +++ regress/cmdline/status.sh @@ -820,7 +820,45 @@ test_status_suppress() { touch $testroot/wt/beta echo "new file" > $testroot/wt/new (cd $testroot/wt && got add new >/dev/null) + + (cd $testroot/wt && got status -S A -s M \ + > $testroot/stdout 2> $testroot/stderr) + ret="$?" + if [ "$ret" = "0" ]; then + echo "status succeeded unexpectedly" >&2 + test_done "$testroot" "1" + return 1 + fi + + echo "got: -s and -S options are mutually exclusive" \ + > $testroot/stderr.expected + cmp -s $testroot/stderr.expected $testroot/stderr + ret="$?" + if [ "$ret" != "0" ]; then + diff -u $testroot/stderr.expected $testroot/stderr + test_done "$testroot" "$ret" + return 1 + fi + + (cd $testroot/wt && got status -s A -S M \ + > $testroot/stdout 2> $testroot/stderr) + ret="$?" + if [ "$ret" = "0" ]; then + echo "status succeeded unexpectedly" >&2 + test_done "$testroot" "1" + return 1 + fi + echo "got: -S and -s options are mutually exclusive" \ + > $testroot/stderr.expected + cmp -s $testroot/stderr.expected $testroot/stderr + ret="$?" + if [ "$ret" != "0" ]; then + diff -u $testroot/stderr.expected $testroot/stderr + test_done "$testroot" "$ret" + return 1 + fi + (cd $testroot/wt && got status -S xDM \ > $testroot/stdout 2> $testroot/stderr) ret="$?"