summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAntti-Juhani Kaijanaho <ajk@debian.org>2011-12-14 20:36:48 +0200
committerAntti-Juhani Kaijanaho <ajk@debian.org>2011-12-14 20:39:13 +0200
commit34ce3e24a1d922b8778ec0b764540e5bc43155b4 (patch)
treea29ed01eb8f0afcaa26943e7b45f99ca80d368a3 /tests
parentfd8f94781f285d202662afea4bd98f68fd7b19d4 (diff)
downloaddctrl-tools-34ce3e24a1d922b8778ec0b764540e5bc43155b4.tar.gz
Bug #652034: Handle multiple instances of the same field gracefully.
For grep-dctrl, this means having -F search for all of the same-name fields disjunctively. The -s option selects all same-name fields for printing. For the other tools, all but the first are ignored. No string changes, so committing to maint-2.20 for release with 2.20.1. Signed-off-by: Antti-Juhani Kaijanaho <ajk@debian.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/bug652034.in3
-rw-r--r--tests/bug652034.out10
-rw-r--r--tests/bug652034.sh9
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/bug652034.in b/tests/bug652034.in
new file mode 100644
index 0000000..287f616
--- /dev/null
+++ b/tests/bug652034.in
@@ -0,0 +1,3 @@
+Foo: a
+Foo: b
+
diff --git a/tests/bug652034.out b/tests/bug652034.out
new file mode 100644
index 0000000..845b68c
--- /dev/null
+++ b/tests/bug652034.out
@@ -0,0 +1,10 @@
+Foo: a
+Foo: b
+
+###
+Foo: a
+Foo: b
+
+###
+Foo: a
+Foo: b
diff --git a/tests/bug652034.sh b/tests/bug652034.sh
new file mode 100644
index 0000000..af5e018
--- /dev/null
+++ b/tests/bug652034.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+set -e
+
+${GREP_DCTRL:-grep-dctrl} -FFoo a bug652034.in
+echo '###'
+${GREP_DCTRL:-grep-dctrl} -FFoo b bug652034.in
+echo '###'
+${GREP_DCTRL:-grep-dctrl} -sFoo -FFoo b bug652034.in