2008-08-03 19:12:25 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright 2008 by Denys Vlasenko
|
2010-08-16 18:14:46 +00:00
|
|
|
# Licensed under GPLv2, see file LICENSE in this source tree.
|
2008-08-03 19:12:25 +00:00
|
|
|
|
2009-11-04 23:41:22 +00:00
|
|
|
. ./testing.sh
|
2008-08-03 19:12:25 +00:00
|
|
|
|
|
|
|
# testing "test name" "command" "expected result" "file input" "stdin"
|
|
|
|
|
2008-08-04 21:30:55 +00:00
|
|
|
testing "xargs -E _ stops on underscore" \
|
|
|
|
"xargs -E _" \
|
2008-08-03 19:12:25 +00:00
|
|
|
"a\n" \
|
|
|
|
"" "a\n_\nb\n"
|
|
|
|
|
2008-08-04 21:30:55 +00:00
|
|
|
testing "xargs -E ''" \
|
|
|
|
"xargs -E ''" \
|
|
|
|
"a _ b\n" \
|
|
|
|
"" "a\n_\nb\n"
|
|
|
|
|
2008-08-03 19:12:25 +00:00
|
|
|
testing "xargs -e without param" \
|
|
|
|
"xargs -e" \
|
|
|
|
"a _ b\n" \
|
|
|
|
"" "a\n_\nb\n"
|
|
|
|
|
2008-08-04 21:30:55 +00:00
|
|
|
testing "xargs does not stop on underscore ('new' GNU behavior)" \
|
|
|
|
"xargs" \
|
|
|
|
"a _ b\n" \
|
|
|
|
"" "a\n_\nb\n"
|
|
|
|
|
2010-06-13 01:43:43 +00:00
|
|
|
testing "xargs -s7 can take one-char input" \
|
2010-06-13 10:43:54 +00:00
|
|
|
"xargs -s7 echo" \
|
2010-06-13 01:43:43 +00:00
|
|
|
"a\n" \
|
|
|
|
"" "a\n"
|
|
|
|
|
2010-06-13 10:43:54 +00:00
|
|
|
testing "xargs -sNUM test 1" \
|
|
|
|
"xargs -ts25 echo 2>&1 >/dev/null" \
|
|
|
|
"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" \
|
|
|
|
"" "1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 00\n"
|
|
|
|
|
|
|
|
testing "xargs -sNUM test 2" \
|
|
|
|
"xargs -ts25 echo 1 2>&1 >/dev/null" \
|
|
|
|
"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" \
|
|
|
|
"" "2 3 4 5 6 7 8 9 0 2 3 4 5 6 7 8 9 00\n"
|
|
|
|
|
2008-08-03 19:12:25 +00:00
|
|
|
exit $FAILCOUNT
|