From 5f57bccc41c8893914121b00e16a96dd16282486 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 9 Sep 2013 04:26:03 -0500 Subject: Redo tail closer to the original design. Add more tests for large data sets. (Still no -f support yet.) --- scripts/test/tail.test | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'scripts/test') diff --git a/scripts/test/tail.test b/scripts/test/tail.test index 77e572e1..f4b86673 100755 --- a/scripts/test/tail.test +++ b/scripts/test/tail.test @@ -39,3 +39,23 @@ testing "tail noseek -c out of bounds" "tail -c 999" "$BIGTEST" "" "$BIGTEST" testing "tail noseek -c+ in bounds" "tail -c +27" \ "x\nseven\neight\nnine\nten\neleven\n" "" "$BIGTEST" testing "tail noseek -c+ out of bonds" "tail -c +999" "" "" "$BIGTEST" + +makebigfile() +{ + + for j in $(seq 1 100) + do + printf "%s " $j + for i in $(seq 1 100) + do + printf %s 123456789abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ + done + echo + done +} +makebigfile > bigfile + +testing "tail -c 12345 -n 3 bigfile" "tail -c 12345 -n 3 bigfile | md5sum" \ + "347bbdcbad8a313f4dc7bd558c5bfcb8 -\n" "" "" +testing "tail -n 3 -c 12345 bigfile" "tail -n 3 -c 12345 bigfile | md5sum" \ + "1698825a750288284ec3ba7d8a59f302 -\n" "" "" -- cgit v1.2.3