[PATCH] test/thread-order: continue loop while $parent is number

Tomi Ollila tomi.ollila at iki.fi
Wed Mar 25 12:07:40 PDT 2015


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 at t$thread> $references"
             parent=${parents[$parent]}
         done
-- 
2.0.0



More information about the notmuch mailing list