summaryrefslogtreecommitdiff
path: root/sys-apps/diffutils/files/diffutils-3.11-tests-seq.patch
blob: 407b76ac05f733e2e14264023983ca7dd1cfc2c2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
https://git.savannah.gnu.org/cgit/diffutils.git/commit/?id=58e734dedd2ed84b559c313b4fbe8e2a1b987a1d

From 58e734dedd2ed84b559c313b4fbe8e2a1b987a1d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 28 Feb 2025 14:32:44 -0800
Subject: tests: make seq replacement more available
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This refactoring should let other future tests use ‘seq’.
* tests/diff3 (seq): Move from here ...
* tests/init.cfg: ... to here.
---
 tests/diff3    | 12 ------------
 tests/init.cfg | 12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/tests/diff3 b/tests/diff3
index e468243..c2079ec 100644
--- a/tests/diff3
+++ b/tests/diff3
@@ -3,18 +3,6 @@
 
 . "${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_
diff --git a/tests/init.cfg b/tests/init.cfg
index 8b3b107..66c26d6 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -120,4 +120,16 @@ require_utf8_locale_()
   test $found_working_tr = 1 || skip_ "failed to find a working tr program"
 }
 
+# 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
+}
+
 sanitize_path_
-- 
cgit v1.1