File: xargs.tests

package info (click to toggle)
busybox 1%3A1.22.0-9%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 16,488 kB
  • ctags: 27,643
  • sloc: ansic: 187,197; sh: 6,816; cpp: 1,428; makefile: 1,029; yacc: 570; lex: 355; perl: 312; python: 255; awk: 29
file content (44 lines) | stat: -rwxr-xr-x 1,017 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# Copyright 2008 by Denys Vlasenko
# Licensed under GPLv2, see file LICENSE in this source tree.

. ./testing.sh

# testing "test name" "command" "expected result" "file input" "stdin"

testing "xargs -E _ stops on underscore" \
	"xargs -E _" \
	"a\n" \
	"" "a\n_\nb\n"

testing "xargs -E ''" \
	"xargs -E ''" \
	"a _ b\n" \
	"" "a\n_\nb\n"

testing "xargs -e without param" \
	"xargs -e" \
	"a _ b\n" \
	"" "a\n_\nb\n"

testing "xargs does not stop on underscore ('new' GNU behavior)" \
	"xargs" \
	"a _ b\n" \
	"" "a\n_\nb\n"

testing "xargs -s7 can take one-char input" \
	"xargs -s7 echo" \
	"a\n" \
	"" "a\n"

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"

exit $FAILCOUNT