[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH 1/2] head: add test case for negative -n invocation
From: Thomas De Schampheleire <patrickdepinguin () gmail ! com>
Date: 2018-09-13 13:01:45
Message-ID: 20180913130146.24330-1-patrickdepinguin () gmail ! com
[Download RAW message or body]
From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Commit 2da9724b56169f00bd7fb6b9a11c9409a7620981 broke 'head -n -1' and was
later reverted with 0d598ab9f03dbf320f7b81c05e4a94cb303dfbc7.
This commit adds a test case to avoid future breakage.
Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
testsuite/head.tests | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100755 testsuite/head.tests
diff --git a/testsuite/head.tests b/testsuite/head.tests
new file mode 100755
index 000000000..1feecf990
--- /dev/null
+++ b/testsuite/head.tests
@@ -0,0 +1,31 @@
+#!/bin/sh
+# Copyright 2018 Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
+# Licensed under GPLv2 or later, see file LICENSE in this source tree.
+
+. ./testing.sh
+
+# testing "test name" "command" "expected result" "file input" "stdin"
+
+cat <<EOF > head.input
+line 1
+line 2
+line 3
+line 4
+line 5
+line 6
+line 7
+line 8
+line 9
+line 10
+line 11
+line 12
+EOF
+
+testing "head -n <negative number>" \
+ "head -n -9 head.input" \
+ "line 1\nline 2\nline 3\n" \
+ "" ""
+
+rm head.input
+
+exit $FAILCOUNT
--
2.16.4
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic