* [PATCH] test/thread-order: continue loop while $parent is number
@ 2015-03-25 19:07 Tomi Ollila
0 siblings, 0 replies; only message in thread
From: Tomi Ollila @ 2015-03-25 19:07 UTC (permalink / raw)
To: notmuch; +Cc: tomi.ollila
Due to possible failure when creating $THREADS data there may
be no 'None' text in the data. If having 'None' in the data
is requirement for the loop to terminate the loop may continue
forever.
Inverting the test to check positive matches for numbers inhibits
this particular problem.
---
test/T260-thread-order.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh
index 99f58336f225..81566e48c98c 100755
--- a/test/T260-thread-order.sh
+++ b/test/T260-thread-order.sh
@@ -45,7 +45,8 @@ for ((n = 0; n < 4; n++)); do
while read -a parents; do
references=""
parent=${parents[$n]}
- while [[ $parent != None ]]; do
+ # require $parent to be 'number' for loop to continue
+ while [[ $parent =~ ^[0-9]+$ ]]; do
references="<m$parent@t$thread> $references"
parent=${parents[$parent]}
done
--
2.0.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-25 19:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-25 19:07 [PATCH] test/thread-order: continue loop while $parent is number Tomi Ollila
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).