tail.tests 652 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. # Copyright 2009 by Denys Vlasenko <vda.linux@googlemail.com>
  3. # Licensed under GPLv2, see file LICENSE in this source tree.
  4. . ./testing.sh
  5. # testing "test name" "command" "expected result" "file input" "stdin"
  6. # file input will be file called "input"
  7. # test can create a file "actual" instead of writing to stdout
  8. testing "tail: +N with N > file length" \
  9. "tail -c +55 2>&1; echo \$?" \
  10. "0\n" \
  11. "" "qw"
  12. testing "tail: -c +N with largish N" \
  13. "
  14. dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8200 | wc -c;
  15. dd if=/dev/zero bs=16k count=1 2>/dev/null | tail -c +8208 | wc -c;
  16. " \
  17. "8185\n8177\n" \
  18. "" ""
  19. exit $FAILCOUNT