Home
last modified time | relevance | path

Searched refs:testcmd (Results 1 – 25 of 44) sorted by relevance

12

/external/toybox/tests/
Dgrep.test12 testcmd "-c" "-c 123 input" "3\n" "123\ncount 123\n123\nfasdfasdf" ""
17 testcmd "-l" "-l test foo foo2 foo3" "foo\nfoo2\n" "" ""
18 testcmd "-L" "-L test foo foo2 foo3" "foo3\n" "" ""
21 testcmd "-q" "-q test input && echo yes" "yes\n" "this is a test\n" ""
22 testcmd "-E" "-E '[0-9]' input" "1234123asdfas123123\n1\n" \
24 testcmd "-e" "-e '[0-9]' input" "1234123asdfas123123\n1\n" \
26 testcmd "-e -e" "-e one -e two -e three input" \
28 testcmd "-F" "-F is input" "this is test\nthis is test2\n" \
30 testcmd "-Fo ''" "-Fo ''" "" "" "hello\n"
31 testcmd "-Fw ''" "-Fw ''" "" "" "hello\n"
[all …]
Dsed.test5 testcmd 'as cat' '""' "one\ntwo\nthree" "" "one\ntwo\nthree"
7 testcmd '- - twice' '"" - -' "hello\n" "" "hello\n"
8 testcmd '-n' '-n ""' "" "" "one\ntwo\nthree"
9 testcmd '-n p' '-n p' "one\ntwo\nthree" "" "one\ntwo\nthree"
10 testcmd 'explicit pattern' '-e p -n' "one\ntwo\nthree" "" "one\ntwo\nthree"
13 testcmd '' '-n 1p' "one\n" "" "one\ntwo\nthree"
14 testcmd '' '2p' "one\ntwo\ntwo\nthree" "" "one\ntwo\nthree"
15 testcmd '' '-n 2p' "two\n" "" "one\ntwo\nthree"
16 testcmd '-n $p' '-n \$p' "three" "" "one\ntwo\nthree"
17 testcmd 'as cat #2' "-n '1,\$p'" "one\ntwo\nthree" "" "one\ntwo\nthree"
[all …]
Dskeleton.test10 testcmd "baseline " "" "$(out '')\n" "" ""
11 testcmd "unknown" "-z |& grep -o Unknown" "Unknown\n" "" ""
12 testcmd "passthrough args" "bingeley bongeley beep" \
14 testcmd "" "-a" "$(out 'flags=1\nSaw a\n')\n" "" ""
15 testcmd "" "-b |& grep -o Missing" "Missing\n" "" ""
16 testcmd "" "-b abc" "$(out 'flags=2\nb=abc\n')\n" "" ""
17 testcmd "" "-c nondigit |& grep -o integer" "integer\n" "" ""
18 testcmd "" "-c 123" "$(out 'flags=4\nc=123\n')\n" "" ""
19 testcmd "" "-c 1m" "$(out 'flags=4\nc=1048576\n')\n" "" ""
20 testcmd "" "-d one -d two -d 3,4" "$(out 'flags=8\nd=one\nd=two\nd=3,4\n')\n" \
[all …]
Dprintf.test12 testcmd "text" "TEXT" "TEXT" "" ""
17 testcmd "escapes" "'one\ntwo\n\v\t\r\f\e\b\athree'" \
19 testcmd "%b escapes" "%b 'one\ntwo\n\v\t\r\f\e\b\athree'" \
22 testcmd "null" "'x\0y' | od -An -tx1" ' 78 00 79\n' "" ""
23 testcmd "trailing slash" "'abc\'" 'abc\' "" ""
41 testcmd "extra args" "'abc%s!%ddef\n' X 42 ARG 36" \
44 testcmd "'%3c'" "'%3c' x" " x" "" ""
45 testcmd "'%-3c'" "'%-3c' x" "x " "" ""
46 testcmd "'%+d'" "'%+d' 5" "+5" "" ""
48 testcmd "'%5d%4d' 1 21 321 4321 54321" \
[all …]
Dcut.test16 testcmd "-b a,a,a" "-b 3,3,3 abc.txt" "e\np\ne\n" "" ""
17 testcmd "-b overlaps" "-b 1-3,2-5,7-9,9-10 abc.txt" \
19 testcmd "-b encapsulated" "-b 3-8,4-6 abc.txt" "e:two:\npha:be\ne quic\n" \
21 testcmd "-bO overlaps" "-O ' ' -b 1-3,2-5,7-9,9-10 abc.txt" \
23 testcmd "high-low error" "-b 8-3 abc.txt 2>/dev/null || echo err" "err\n" \
26 testcmd "-c a-b" "-c 4-10 abc.txt" ":two:th\nha:beta\n quick \n" "" ""
27 testcmd "-c a-" "-c 41- abc.txt" "\ntheta:iota:kappa:lambda:mu\ndog\n" "" ""
28 testcmd "-c -b" "-c -39 abc.txt" \
31 testcmd "-c a" "-c 40 abc.txt" "\n:\n \n" "" ""
32 testcmd "-c a,b-c,d" "-c 3,5-7,10 abc.txt" "etwoh\npa:ba\nequi \n" "" ""
[all …]
Drealpath.test15 testcmd '' '.' "$TOP\n" '' ''
16 testcmd 'missing' 'missing' "$TOP/missing\n" '' ''
17 testcmd 'missing2' 'missing/sub 2>/dev/null || echo err' 'err\n' '' ''
18 testcmd '-z' '-z . | tr "\0" X' "${TOP}X" '' ''
19 testcmd 'file' 'file' "$TOP/file\n" '' ''
20 testcmd 'dir' 'one/two/three' "$TOP/one/two/three\n" '' ''
21 testcmd '--relative-to' '. --relative-to=one/two/three' '../../..\n' '' ''
22 testcmd '--relative-to2' \
25 testcmd '--relative-to3' '-m walrus --relative-to walrus' '.\n' '' ''
26 testcmd '--relative-to4' '"$PWD" --relative-to one' '..\n' '' ''
[all …]
Decho.test12 testcmd "echo" "&& $C yes" "\nyes\n" "" ""
13 testcmd "1 2 3" "one two three" "one two three\n" "" ""
14 testcmd "with spaces" "'one two three'" \
16 testcmd "" "-n" "" "" ""
17 testcmd "" "-n one" "one" "" ""
18 testcmd "" "one -n" "one -n\n" "" ""
19 testcmd "-en" "-en 'one\ntwo'" "one\ntwo" "" ""
20 testcmd "" "--hello" "--hello\n" "" ""
21 testcmd "-e all" "-e '\a\b\c\f\n\r\t\v\\\0123' | xxd -p" "0708\n" "" ""
22 testcmd "-e all but \\c" "-e '"'\a\b\f\n\r\t\v\\\0123'"' | xxd -p" \
[all …]
Dls.test17 testcmd "no argument" "" "dir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
18 testcmd "-C column spacing equals 2" "-C" "dir1 dir2 file1.txt file2.txt\n" \
20 testcmd "-x column spacing equals 2" "-x" "dir1 dir2 file1.txt file2.txt\n" \
22 testcmd "explicit files" "file*" "file1.txt\nfile2.txt\n" "" ""
23 testcmd "explicit -1" "-1 file*" "file1.txt\nfile2.txt\n" "" ""
24 testcmd "" "-p" "dir1/\ndir2/\nfile1.txt\nfile2.txt\n" "" ""
25 testcmd "" "-a" ".\n..\n.hfile1\ndir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
26 testcmd "" "-A" ".hfile1\ndir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
27 testcmd "" "-d" ".\n" "" ""
28 testcmd "" "-d *" "dir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
[all …]
Dxxd.test12 testcmd "file1" "file1" \
15 testcmd "file1 -l" "-l 2 file1" \
18 testcmd "-" "-" \
20 testcmd "no args" "" \
22 testcmd "-c 8 -g 4 file1" "-c 8 -g 4 file1" \
24 testcmd "-c 8 -g 3 file1" "-c 8 -g 3 file1" \
27 testcmd "-i" "-i - < file1" " 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x…
29 testcmd "-o 0x8000" "-o 0x8000 file1" "00008000: 7468 6973 2069 7320 736f 6d65 2074 6578 this is s…
31 testcmd "-p" "-p file1" "7468697320697320736f6d6520746578740a\n" "" ""
34 toyonly testcmd "-pc0" "-pc0" \
[all …]
Dtest.test7 testcmd "-- isn't parsed" "-- == -- && echo yes" "yes\n" "" ""
10 testcmd 'no args is false' '; echo $?' '1\n' '' ''
11 testcmd 'empty string is false' '""; echo $?' '1\n' '' ''
12 testcmd '1 arg is true if not empty string' '== ; echo $?' '0\n' '' ''
13 testcmd "1 arg isn't an operand" '-t 2>&1; echo $?' '0\n' '' ''
14 testcmd '2 args' '-e == ; echo $?' '1\n' '' ''
15 testcmd '3 args' '-e == -e ; echo $?' '0\n' '' ''
18 testcmd '' '\( == \) ; echo $?' '1\n' '' ''
19 testcmd '' '\( == \( ; echo $?' '0\n' '' ''
20 testcmd '' '\( "" \) ; echo $?' '1\n' '' ''
[all …]
Dcmp.test6 testcmd "one argument match" 'input && echo yes' "yes\n" \
9 testcmd "one argument diff" 'input | sed s/byte/char/' \
12 testcmd "missing file1 [fail]" 'file1 input 2>/dev/null || echo $?' "2\n" "foo" ""
22 testcmd "identical files, stdout" "input input2" "" "ab\nc\n" ""
23 testcmd "identical files, return code" "input input2 && echo yes" "yes\n" "ab\nc\n" ""
25 testcmd "EOF, stderr" "input input2 2>&1" \
27 testcmd "EOF, return code" "input input2 2>/dev/null || echo yes" "yes\n" "ab\nc\nx" ""
29 testcmd "diff, stdout" "input input2 | sed s/byte/char/" \
31 testcmd "diff, return code" "input input2 > /dev/null || echo yes" "yes\n" "ab\nx\nx" ""
33 testcmd "-s EOF, return code" "-s input input2 2>&1 || echo yes" "yes\n" "ab\nc\nx" ""
[all …]
Dtimeout.test8 testcmd "times out" '.1 sleep 100 ; echo $?' '124\n' '' ''
9 testcmd "failure" '-s MONKEY .1 sleep 100 2>/dev/null ; echo $?' '125\n' '' ''
10 testcmd "early failure" '2>/dev/null ; echo $?' '125\n' '' ''
11 testcmd "can't execute" '.1 / 2>/dev/null ; echo $?' '126\n' '' ''
12 testcmd "can't find" '.1 /does/not/exist 2>/dev/null ; echo $?' '127\n' '' ''
13 testcmd "custom signal" '-s 3 .1 sleep 100; echo $?' '124\n' '' ''
14 testcmd "killed" '-s 9 .1 sleep 100; echo $?' '137\n' '' ''
15 testcmd "TERM" '-s TERM .1 sleep 100; echo $?' '124\n' '' ''
16 testcmd "exit 0" '.1 true ; echo $?' '0\n' '' ''
17 testcmd "exit 1" '.1 false ; echo $?' '1\n' '' ''
[all …]
Dhead.test7 testcmd "stdin" "-n 1 && echo yes" "one\nyes\n" "" "one\ntwo"
8 testcmd "stdin via -" "-n 1 - && echo yes" "one\nyes\n" "" "one\ntwo"
9 testcmd "file" "input -n 1 && echo yes" "one\nyes\n" "one\ntwo" ""
10 testcmd "-number" "-2 input && echo yes" "one\ntwo\nyes\n" \
12 testcmd "default lines" "" "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n" "" "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\…
15 testcmd "-v file" "-v -n 1 input" "==> input <==\none\n" "one\ntwo\n" ""
16 testcmd "-v stdin" "-v -n 1 | sed 's/standard input/-/'" \
19 testcmd "file and stdin" "-n 1 input - | sed 's/standard input/-/'" \
25 testcmd "multiple files" "-n 2 input file1" \
27 testcmd "-q, multiple files" "-q -n 2 input file1" "one\ntwo\nfoo\nbar\n" \
[all …]
Dhexdump.test5 testcmd "simple file" "input" "0000000 6973 706d 656c 000a\n0000007\n" "simple\\n" ""
6 testcmd "simple file -b" "-b input" "0000000 163 151 155 160 154 145 012\n0000007\n" "simple\\n" ""
7 testcmd "simple file -c" "-c input" "0000000 s i m p l e \\\\n\n0000007\n" "simple\\n"…
8 testcmd "simple file -d" "-d input" "0000000 26995 28781 25964 00010\n0000007\n" "simple\\n" ""
9 testcmd "simple file -o" "-o input" "0000000 064563 070155 062554 000012\n0000007\n" "simple\\n" ""
10 testcmd "simple file -x" "-x input" "0000000 6973 706d 656c 000a\n0000007\n" "simple\\n" ""
12 testcmd \
20 testcmd \
32 testcmd \
40 testcmd \
[all …]
Dbasename.test8 testcmd "/-only" "///////" "/\n" "" ""
9 testcmd "trailing /" "a//////" "a\n" "" ""
10 testcmd "combined" "/////a///b///c///d/////" "d\n" "" ""
13 testcmd "suffix" "a/b/c/d.suffix .suffix" "d\n" "" ""
16 testcmd "suffix=result" ".txt .txt" ".txt\n" "" ""
19 testcmd "reappearing suffix 1" "a.txt.txt .txt" "a.txt\n" "" ""
20 testcmd "reappearing suffix 2" "a.txt.old .txt" "a.txt.old\n" "" ""
23 testcmd "invalid suffix" "isthisasuffix? suffix" "isthisasuffix?\n" "" ""
26 testcmd "zero-length suffix" "a/b/c ''" "c\n" "" ""
29 testcmd "-s" "-s .txt /a/b/c.txt" "c\n" "" ""
[all …]
Ddemo_number.test7 testcmd "l 1024" "-h 123456789" "118M\n" "" ""
8 testcmd "l 1000" "-d 123456789" "123M\n" "" ""
9 testcmd "s 1024" "-h 5675" "5.5K\n" "" ""
10 testcmd "s 1000" "-d 5675" "5.6k\n" "" ""
14 testcmd "edge case" "-h 267350" "261K\n" "" ""
16 testcmd "-b" "-b 123" "123B\n" "" ""
17 testcmd "-b" "-b 123456789" "118M\n" "" ""
18 testcmd "-s" "-s 123456789" "118 M\n" "" ""
19 testcmd "-bs" "-bs 123456789" "118 M\n" "" ""
21 testcmd "units" "-b 1c 1b 1k 1kd 1m 1md 1g 1gd 1t 1td 1e 1ed" \
[all …]
Ddiff.test8 testcmd "unknown argument" '--oops left right 2>/dev/null ; echo $?' "2\n" "" ""
9 testcmd "missing" 'missing1 missing2 2>/dev/null ; echo $?' "2\n" "" ""
11 testcmd "- -" '- - ; echo $?' "0\n" "" "whatever"
13 testcmd "simple" "-u -L lll -L rrr left right" '--- lll
27 testcmd "-r" "-u -r -L tree1/file -L tree2/file tree1 tree2 | grep -v ^diff" \
37 testcmd "--strip-trailing-cr off" "-q a b" "Files a and b differ\n" "" ""
38 testcmd "--strip-trailing-cr on" '-u --strip-trailing-cr a b; echo $?' \
43 testcmd "line format" "--unchanged-line-format=U%l --old-line-format=D%l --new-line-format=A%l aa b…
44 testcmd "line format empty" "--unchanged-line-format= --old-line-format=D%l --new-line-format=A%l a…
50 testcmd "fifos" "-u -L fifo1 -L fifo2 fifo1 fifo2" '--- fifo1
[all …]
Denv.test11 testcmd "read" "$FILTER" "BANANA=hello\nLETTERS=\nWALRUS=42\n" "" ""
12 testcmd "-u" "-u BANANA $FILTER" "LETTERS=\nWALRUS=42\n" "" ""
13 testcmd "-uu" "-u LETTERS -u WALRUS $FILTER" "BANANA=hello\n" "" ""
14 testcmd "-i uses old \$PATH" "-i echo hello" "hello\n" "" ""
15 testcmd "-i env" "-i env" "" "" ""
16 testcmd "-i =" "-i one=two three=four $C | sort" \
18 testcmd "-0" "-i five=six seven=eight $C -0 | sort -z" "five=six\0seven=eight\0" "" ""
21 testcmd "early fail" '--oops 2> /dev/null ; echo $?' "125\n" "" ""
22 testcmd "why is this allowed" "=BLAH env | grep '^=BLAH\$'" "=BLAH\n" "" ""
24 testcmd "replace" "A=foo PATH= `which printenv` A" "foo\n" "" ""
[all …]
Dbase64.test7 testcmd "simple" "" "c2ltcGxlCg==\n" "" "simple\n"
8 testcmd "file" "input" "c2ltcGxlCg==\n" "simple\n" ""
9 testcmd "simple -d" "-d" "simple\n" "" "c2ltcGxlCg==\n"
10 testcmd "simple -d" "-d input" "simple\n" "c2ltcGxlCg==" ""
11 testcmd "default wrap" "" \
14 testcmd "multiline -d " "-d" \
18 testcmd "-w" "-w 10" \
22 testcmd "-w0" "-w0 input" \
Dbase32.test7 testcmd "simple" "" "ONUW24DMMUFA====\n" "" "simple\n"
8 testcmd "file" "input" "ONUW24DMMUFA====\n" "simple\n" ""
9 testcmd "simple -d" "-d" "simple\n" "" "ONUW24DMMUFA====\n"
10 testcmd "file -d" "-d input" "simple\n" "ONUW24DMMUFA====" ""
11 testcmd "default wrap" "" \
14 testcmd "multiline -d " "-d" \
18 testcmd "-w" "-w 10" \
22 testcmd "-w0" "-w0 input" \
Dstat.test8 testcmd "as echo" "-c hello file" "hello\n" "" ""
9 testcmd "lone %" "-c % file" "%\n" "" ""
10 testcmd "%% escapes" "-c '%% and %% then %%' file" "% and % then %\n" "" ""
11 testcmd "%unknown = ?" "-c %q% file" "?%\n" "" ""
13 TZ=utc testcmd "%x" "-c %x file" "2000-01-01 01:01:01.000000000 +0000\n" "" ""
14 TZ=utc testcmd "%X" "-c %X file" "946688461\n" "" ""
17 TZ=utc testcmd "%y" "-c %y file" "2000-02-02 02:02:02.000000000 +0000\n" "" ""
18 TZ=utc testcmd "%Y" "-c %Y file" "949456922\n" "" ""
Dsort.test107 testcmd "-c" "-c 2>&1 | grep -o [0-9]*" "3\n" "" "a\nb\na\nc"
108 testcmd "-uc" "-uc 2>&1 | grep -o [0-9]*" "3\n" "" "a\nb\nb\nc"
109 testcmd "-C 1" "-C || echo yes" "yes\n" "" "one\ntwo\nthree"
110 testcmd "-C 2" "-C && echo yes" "yes\n" "" "a\nb\nc\n"
120 testcmd '-n without number sorts as leading zero' '-n' \
123 testcmd '-u implies -s' '-uk2,2n' 'zero 1\nthree 2\nfour 3\n' '' \
Dlosetup.test33 testcmd "-f" "-f" "$DIR/loop0\n" "" ""
34 testcmd "-f blah.img" "-f blah.img" "" "" ""
35 testcmd "-f --show" "-f --show blah.img" "$DIR/loop1\n" "" ""
36 testcmd "-a" "-a | sort" \
38 testcmd "-d $DIR/loop0" "-d $DIR/loop0 && losetup -a" \
40 testcmd "-D" "-D && losetup -a" "" "" ""
Dpidof.test16 testcmd "short argv[1]" "pidof-$$.test" "" "" ""
17 testcmd "short argv[1] -x" "-x pidof-$$.test" "$pid\n" "" ""
22 testcmd "long argv[1]" "toybox.pidof-$$.test.script" "" "" ""
23 testcmd "long argv[1] -x" "-x toybox.pidof-$$.test.script" "$pid\n" "" ""
29 testcmd "pidof pidof" "pidof > /dev/null && echo found" "found\n" "" ""
Dsha1sum.test45 testcmd "abc" "" "$ABC -\n" "" "abc"
46 testcmd "longer str" "" "$ABCLONG -\n"\
56 testcmd "file" "input" "$ABC input\n" "abc" ""
57 testcmd "file1 file2" "input file2" "$ABC input\n$DEF file2\n" "abc" ""
58 testcmd "file1 file2 -" "input file2 -" "$ABC input\n$DEF file2\n$ABC -\n" \

12