diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/dd.test | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/dd.test b/tests/dd.test index 42cd170a..82214506 100755 --- a/tests/dd.test +++ b/tests/dd.test @@ -10,6 +10,12 @@ opt="2>/dev/null" #testing "name" "command" "result" "infile" "stdin" +# Test suffixed number parsing; `count` is representative. +testing "count=2" "dd if=input count=2 ibs=1 $opt" "hi" "high\n" "" +testing "count= 2" "dd if=input 'count= 2' ibs=1 $opt" "hi" "high\n" "" +testing "count=0x2" "dd if=input 'count=0x2' ibs=1 $opt" "hi" "high\n" "" +testing "count=-2" "dd if=input 'count=-2' ibs=1 2>&1" "dd: invalid number '-2'\n" "" "" + testing "if=(file)" "dd if=input $opt" "I WANT\n" "I WANT\n" "" testing "of=(file)" "dd of=file $opt && cat file" "I WANT\n" "" "I WANT\n" testing "if=file of=file" "dd if=input of=foo $opt && cat foo && rm -f foo" \ @@ -61,9 +67,6 @@ testing "with skip if" "dd skip=0 if=input $opt" "I WANT\n" "I WANT\n" "" testing "with seek" "dd seek=0 $opt" "I WANT\n" "" "I WANT\n" testing "with seek if" "dd seek=0 if=input $opt" "I WANT\n" "I WANT\n" "" -# These type of conv is not supported in toybox: 'ascii', 'ebcdic', 'ibm', -# 'block', 'unblock', 'nocreat', 'notronc', 'lcase', 'ucase', 'excl', 'swab' - # Testing only 'notrunc', 'noerror', 'fsync', 'sync' testing "conv=notrunc" "dd conv=notrunc $opt" "I WANT\n" "" "I WANT\n" @@ -81,3 +84,7 @@ testing "conv=fsync with IF" "dd conv=fsync if=input $opt" "I WANT\n" \ testing "conv=sync" "dd conv=sync $opt | head -n 1" "I WANT\n" "" "I WANT\n" testing "conv=sync with IF" "dd conv=sync if=input $opt | head -n 1" "I WANT\n" \ "I WANT\n" "" + +# status=noxfer|none +testing "status=noxfer" "dd if=input status=noxfer ibs=1 2>&1" "input\n6+0 records in\n0+1 records out\n" "input\n" "" +testing "status=none" "dd if=input status=none ibs=1 2>&1" "input\n" "input\n" "" |