trimslash.test 651 B

123456789101112131415161718192021222324252627
  1. #! /bin/sh
  2. # Copyright (C) 2002 by Martin Pool <mbp@samba.org>
  3. # This program is distributable under the terms of the GNU GPL (see
  4. # COPYING).
  5. # Test tiny function to trim trailing slashes.
  6. . "$suitedir/rsync.fns"
  7. "$TOOLDIR/trimslash" "/usr/local/bin" "/usr/local/bin/" "/usr/local/bin///" \
  8. "//a//" "////" \
  9. "/Users/Wierd Macintosh Name/// Ooh, translucent plastic/" \
  10. > "$scratchdir/slash.out"
  11. diff $diffopt "$scratchdir/slash.out" - <<EOF
  12. /usr/local/bin
  13. /usr/local/bin
  14. /usr/local/bin
  15. //a
  16. /
  17. /Users/Wierd Macintosh Name/// Ooh, translucent plastic
  18. EOF
  19. # The script would have aborted on error, so getting here means we've won.
  20. exit 0