From e465262e4e32331ce3b935f484932cfdd4753110 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Wed, 25 Mar 2015 21:07:40 +0200 Subject: [PATCH] [PATCH] test/thread-order: continue loop while $parent is number --- f0/6ba99e4e65047da702a2c1872f8594acdee035 | 69 +++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 f0/6ba99e4e65047da702a2c1872f8594acdee035 diff --git a/f0/6ba99e4e65047da702a2c1872f8594acdee035 b/f0/6ba99e4e65047da702a2c1872f8594acdee035 new file mode 100644 index 000000000..8d910d851 --- /dev/null +++ b/f0/6ba99e4e65047da702a2c1872f8594acdee035 @@ -0,0 +1,69 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id E4A6B431FC0 + for ; Wed, 25 Mar 2015 12:08:11 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id zDqtLu2ztgTY for ; + Wed, 25 Mar 2015 12:08:08 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 95240431FBC + for ; Wed, 25 Mar 2015 12:08:08 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id B50E61000F4; Wed, 25 Mar 2015 21:07:46 +0200 (EET) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH] test/thread-order: continue loop while $parent is number +Date: Wed, 25 Mar 2015 21:07:40 +0200 +Message-Id: <1427310460-15801-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.0.0 +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 25 Mar 2015 19:08:12 -0000 + +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=" $references" + parent=${parents[$parent]} + done +-- +2.0.0 + -- 2.26.2