summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-08-14 22:25:49 -0700
committerJim Meyering <meyering@fb.com>2016-08-14 22:25:49 -0700
commitc61efccd23c827a03bdd1d41211c70479a632b86 (patch)
tree78420391b3ffd374f2ca980045e329b07fee8f90
parentedd942ca27d570a33d612b12eecaa33a76640e46 (diff)
downloaddiffutils-c61efccd23c827a03bdd1d41211c70479a632b86.tar.gz
tests: diff3: work around missing seq on some systems
* tests/diff3 (seq): Provide a seq replacement function, since at least AIX, SunOS 5.10, OpenBSD-5.8 lack it. Reported by Assaf Gordon in https://bugs.gnu.org/24227#8
-rw-r--r--tests/diff312
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/diff3 b/tests/diff3
index a40631b..b591751 100644
--- a/tests/diff3
+++ b/tests/diff3
@@ -3,6 +3,18 @@
. "${srcdir=.}/init.sh"; path_prepend_ ../src
+# Some systems lack seq.
+# A limited replacement for seq: handle 1 or 2 args; increment must be 1
+seq()
+{
+ case $# in
+ 1) start=1 final=$1;;
+ 2) start=$1 final=$2;;
+ *) echo you lose 1>&2; exit 1;;
+ esac
+ awk 'BEGIN{for(i='$start';i<='$final';i++) print i}' < /dev/null
+}
+
echo a > a || framework_failure_
echo b > b || framework_failure_
echo c > c || framework_failure_