aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2019-01-18 16:54:13 -0800
committerRob Landley <rob@landley.net>2019-01-18 22:17:58 -0600
commite47144c8d0bc4fe1986403ade1e3d54a5c94f993 (patch)
tree1084cc7ceaf44539291e5135f4430caf81a316e4 /tests
parentad63ea18f8ff3c5e84fcec74a77c2a8146725eb2 (diff)
downloadtoybox-e47144c8d0bc4fe1986403ade1e3d54a5c94f993.tar.gz
xargs: make --help match reality.
Implement -p, -t, and -r. Add some missing tests. Move -L and -x back to TODO since they're not implemented and I haven't yet even understood what they're supposed to do.
Diffstat (limited to 'tests')
-rw-r--r--tests/xargs.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/xargs.test b/tests/xargs.test
index 407817cc..dce93ed3 100644
--- a/tests/xargs.test
+++ b/tests/xargs.test
@@ -27,6 +27,17 @@ rm one two three
testing "-0 -n1" "printf 'a\0b\0c\0d\0e\0f' | xargs -0 -n1 echo _" "_ a\n_ b\n_ c\n_ d\n_ e\n_ f\n" "" ""
testing "-0 -n2" "printf 'a\0b\0c\0d\0e\0f' | xargs -0 -n2 echo _" "_ a b\n_ c d\n_ e f\n" "" ""
+testing "-t" "xargs -t 2>stderr ; cat stderr ; rm stderr" "one two\necho one two \n" "" "one\ntwo\n"
+
+testing "-E END" "xargs -E END" "a b\n" "" "a\nb\nEND\nc\nd\n"
+
+testing "-r" "xargs -r echo x" "" "" ""
+
+# TODO: what exactly is -x supposed to do? why does coreutils output "one"?
+#testing "-x" "xargs -x -s 9 || echo expected" "one\nexpected\n" "" "one\ntwo\nthree"
+
+# TODO: test for -L? what exactly is the difference between -n and -L?
+
#testing "-n exact match"
#testing "-s exact match"
#testing "-s 0"