From 77997b8e774318631b373a443dc073d3b38b5d84 Mon Sep 17 00:00:00 2001 From: Ilya Kuzmich Date: Sun, 28 May 2017 18:29:19 +0300 Subject: teach head -c Not POSIX, but implemented in coreutils, busybox and freebsd. --- tests/head.test | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/head.test') 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" -- cgit v1.2.3