Newer
Older
dub_jkp / test / issue2574-mistyping-commands.sh
  1. #!/usr/bin/env bash
  2.  
  3. . $(dirname "${BASH_SOURCE[0]}")/common.sh
  4.  
  5. $DUB upfrade 2>&1 >/dev/null && die $LINENO '"dub upfrade" should not succeed'
  6.  
  7. if [ "$($DUB upfrade 2>&1 | grep -Fc "Unknown command: upfrade")" != "1" ]; then
  8. die $LINENO 'Missing Unknown command line'
  9. fi
  10.  
  11. if [ "$($DUB upfrade 2>&1 | grep -Fc "Did you mean 'upgrade'?")" != "1" ]; then
  12. die $LINENO 'Missing upgrade suggestion'
  13. fi
  14.  
  15. if [ "$($DUB upfrade 2>&1 | grep -Fc "build")" != "0" ]; then
  16. die $LINENO 'Did not expect to see build as a suggestion and did not want a full list of commands'
  17. fi