From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68573 invoked by alias); 18 Mar 2015 14:12:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 68544 invoked by uid 89); 18 Mar 2015 14:12:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 18 Mar 2015 14:12:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 80313116319; Wed, 18 Mar 2015 10:12:38 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 4ixZh0IkjWKh; Wed, 18 Mar 2015 10:12:38 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 42AD2116316; Wed, 18 Mar 2015 10:12:38 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 77E1F40FC6; Wed, 18 Mar 2015 10:12:38 -0400 (EDT) Date: Wed, 18 Mar 2015 14:12:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: Pierre-Marie de Rodat , GDB Patches Subject: Re: [PATCH] Share the "multi_line" helper among all Ada testcases Message-ID: <20150318141238.GE7494@adacore.com> References: <54FEDB92.9060808@adacore.com> <20150317200809.GD7494@adacore.com> <5509492C.5000604@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5509492C.5000604@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-03/txt/msg00543.txt.bz2 > Meanwhile, we grew many tests that do [join [list ... "\r\n"]], > like this: > > # start by listing all functions > gdb_test "record function-call-history /ci 1, +20" [join [list \ > "1\tmain\tinst 1,1" \ > "2\t fun4\tinst 2,4" \ > "3\t fun1\tinst 5,8" \ > "4\t fun4\tinst 9,9" \ > "5\t fun2\tinst 10,12" \ > "6\t fun1\tinst 13,16" \ > "7\t fun2\tinst 17,18" \ > "8\t fun4\tinst 19,19" \ > "9\t fun3\tinst 20,22" \ > "10\t fun1\tinst 23,26" \ > "11\t fun3\tinst 27,27" \ > "12\t fun2\tinst 28,30" \ > "13\t fun1\tinst 31,34" \ > "14\t fun2\tinst 35,36" \ > "15\t fun3\tinst 37,38" \ > "16\t fun4\tinst 39,40" \ > ] "\r\n"] > > Your multi_line looks like almost the same, except that it's > a tiny bit more lax: > > proc multi_line { args } { > return [join $args "\[\r\n\]*"] > } > > That will accept _no_ newline between list elements, and > multiple newlines too. How about making multi_line join > with strict "\r\n" too? Then if you need to match one > empty line, you can do: > > [multi_line "line1" \ > "" > "line3"] > > and if you need multiple, you can always do: > > [multi_line "line1" \ > "\[\r\n\]*" > "lineNN"] Very good suggestion, I like it! Pierre-Marie? -- Joel