From 3f78ee9a3cebec797faa9c6578350ff4ecb670d8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 16 Jan 2017 16:28:51 +0200 Subject: Specify shared here-document testscript feature --- doc/testscript.cli | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'doc/testscript.cli') diff --git a/doc/testscript.cli b/doc/testscript.cli index ed23727..00b2786 100644 --- a/doc/testscript.cli +++ b/doc/testscript.cli @@ -1886,7 +1886,7 @@ here-document: \ A here-document can be used to supply data to \c{stdin} or to compare output -to the expected result for \c{stdout} and \c{stderr}. Note that the order of +to the expected result for \c{stdout} and \c{stderr}. The order of here-document fragments must match the order of redirects, for example: \ @@ -1900,6 +1900,20 @@ error: no such table 'no_such_table' EOE \ +Two or more here-document redirects can use the same end marker. In this case +all the redirects must have the same modifiers, if any. Only the here-document +fragment corresponding to the first occurrence of the end marker must be +present (called \i{shared} here-document) with the subsequent redirects +reusing the same data. This mechanism is primarily useful for round-trip +testing, for example: + +\ +: xml-round-trip +$* <>EOD +Hello, World! +EOD +\ + Here-strings can be single-quoted literals or double-quoted with expansion. This semantics is extended to here-documents as follows: If the end marker on the command line is single-quoted, then the here-document lines are -- cgit v1.1