[PATCH] test/thread-order: continue loop while $parent is number
authorTomi Ollila <tomi.ollila@iki.fi>
Wed, 25 Mar 2015 19:07:40 +0000 (21:07 +0200)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:48:36 +0000 (14:48 -0700)
f0/6ba99e4e65047da702a2c1872f8594acdee035 [new file with mode: 0644]

diff --git a/f0/6ba99e4e65047da702a2c1872f8594acdee035 b/f0/6ba99e4e65047da702a2c1872f8594acdee035
new file mode 100644 (file)
index 0000000..8d910d8
--- /dev/null
@@ -0,0 +1,69 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id E4A6B431FC0\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Mar 2015 12:08:11 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.438\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
+       tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id zDqtLu2ztgTY for <notmuch@notmuchmail.org>;\r
+       Wed, 25 Mar 2015 12:08:08 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 95240431FBC\r
+       for <notmuch@notmuchmail.org>; Wed, 25 Mar 2015 12:08:08 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id B50E61000F4; Wed, 25 Mar 2015 21:07:46 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] test/thread-order: continue loop while $parent is number\r
+Date: Wed, 25 Mar 2015 21:07:40 +0200\r
+Message-Id: <1427310460-15801-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.0.0\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 25 Mar 2015 19:08:12 -0000\r
+\r
+Due to possible failure when creating $THREADS data there may\r
+be no 'None' text in the data. If having 'None' in the data\r
+is requirement for the loop to terminate the loop may continue\r
+forever.\r
+Inverting the test to check positive matches for numbers inhibits\r
+this particular problem.\r
+---\r
+ test/T260-thread-order.sh | 3 ++-\r
+ 1 file changed, 2 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/test/T260-thread-order.sh b/test/T260-thread-order.sh\r
+index 99f58336f225..81566e48c98c 100755\r
+--- a/test/T260-thread-order.sh\r
++++ b/test/T260-thread-order.sh\r
+@@ -45,7 +45,8 @@ for ((n = 0; n < 4; n++)); do\r
+     while read -a parents; do\r
+         references=""\r
+         parent=${parents[$n]}\r
+-        while [[ $parent != None ]]; do\r
++        # require $parent to be 'number' for loop to continue\r
++        while [[ $parent =~ ^[0-9]+$ ]]; do\r
+             references="<m$parent@t$thread> $references"\r
+             parent=${parents[$parent]}\r
+         done\r
+-- \r
+2.0.0\r
+\r