xargs.tests 1017 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/sh
  2. # Copyright 2008 by Denys Vlasenko
  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. testing "xargs -E _ stops on underscore" \
  7. "xargs -E _" \
  8. "a\n" \
  9. "" "a\n_\nb\n"
  10. testing "xargs -E ''" \
  11. "xargs -E ''" \
  12. "a _ b\n" \
  13. "" "a\n_\nb\n"
  14. testing "xargs -e without param" \
  15. "xargs -e" \
  16. "a _ b\n" \
  17. "" "a\n_\nb\n"
  18. testing "xargs does not stop on underscore ('new' GNU behavior)" \
  19. "xargs" \
  20. "a _ b\n" \
  21. "" "a\n_\nb\n"
  22. testing "xargs -s7 can take one-char input" \
  23. "xargs -s7 echo" \
  24. "a\n" \
  25. "" "a\n"
  26. testing "xargs -sNUM test 1" \
  27. "xargs -ts25 echo 2>&1 >/dev/null" \
  28. "echo 1 2 3 4 5 6 7 8 9 0\n""echo 1 2 3 4 5 6 7 8 9\n""echo 00\n" \
  29. "" "1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 00\n"
  30. testing "xargs -sNUM test 2" \
  31. "xargs -ts25 echo 1 2>&1 >/dev/null" \
  32. "echo 1 2 3 4 5 6 7 8 9 0\n""echo 1 2 3 4 5 6 7 8 9\n""echo 1 00\n" \
  33. "" "2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 00\n"
  34. exit $FAILCOUNT