aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIlya Kuzmich <ilya.kuzmich@gmail.com>2017-05-28 18:29:19 +0300
committerRob Landley <rob@landley.net>2017-06-27 14:55:29 -0500
commit77997b8e774318631b373a443dc073d3b38b5d84 (patch)
tree1c7dc8c8a7ce757bfe5a447221714239c5a5ea27 /tests
parentf30035e88bad1748e8e5546ef43409862db1d91e (diff)
downloadtoybox-77997b8e774318631b373a443dc073d3b38b5d84.tar.gz
teach head -c
Not POSIX, but implemented in coreutils, busybox and freebsd.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/head.test4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/head.test b/tests/head.test
index 6ed027c4..4e4c01bd 100755
--- a/tests/head.test
+++ b/tests/head.test
@@ -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"