OSDN Git Service

teach head -c
[android-x86/external-toybox.git] / tests / head.test
index 6ed027c..4e4c01b 100755 (executable)
@@ -27,3 +27,7 @@ testing "-q, multiple files" "head -q -n 2 input file1" "one\ntwo\nfoo\nbar\n" \
        "one\ntwo\nthree\n" ""
 rm file1
 
+testing "-c 3" "head -c 3" "one" "" "one\ntwo"
+testing "-c bigger than input" "head -c 3" "a" "" "a"
+testing "-c 3 -n 1" "head -c 3 -n 1" "one\n" "" "one\ntwo"
+testing "-n 1 -c 3" "head -n 1 -c 3" "one" "" "one\ntwo"