logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/

cksum.sh (693B)


  1. #!/bin/sh
  2. # SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
  3. # SPDX-License-Identifier: MPL-2.0
  4. WD="$(dirname "$0")"
  5. target="${WD}/../cmd/cksum"
  6. plans=5
  7. . "$(dirname "$0")/tap.sh"
  8. if test "$(uname -s)" = "FreeBSD"
  9. then
  10. skip devnull 'FreeBSD treats posix_fadvise on /dev/null as invalid'
  11. else
  12. t devnull '/dev/null' '4294967295 0 /dev/null
  13. '
  14. fi
  15. t empty "$WD/inputs/empty" "4294967295 0 $WD/inputs/empty
  16. "
  17. t --input='' 'empty_stdin' '' '4294967295 0
  18. '
  19. t all_bytes "$WD/inputs/all_bytes" "1313719201 256 $WD/inputs/all_bytes
  20. "
  21. t --exit=1 'enoent' '/var/empty/e/no/ent' "cksum: error: Failed opening file '/var/empty/e/no/ent': No such file or directory
  22. "