diff options
author | Rob Landley <rob@landley.net> | 2013-09-09 04:26:03 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-09-09 04:26:03 -0500 |
commit | 5f57bccc41c8893914121b00e16a96dd16282486 (patch) | |
tree | 740fe030a8ffd4f238cc0b86f35af8e8db227aac /scripts/test/tail.test | |
parent | 9d4cd46b82b4e5d05c26dc4fa40ef20174ca0355 (diff) | |
download | toybox-5f57bccc41c8893914121b00e16a96dd16282486.tar.gz |
Redo tail closer to the original design. Add more tests for large data sets. (Still no -f support yet.)
Diffstat (limited to 'scripts/test/tail.test')
-rwxr-xr-x | scripts/test/tail.test | 20 |
1 files changed, 20 insertions, 0 deletions
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" "" "" |