Thread (54 messages) 54 messages, 6 authors, 2016-06-15

Re: [PATCH 15/25] t9502: fix &&-chain breakage

From: Johannes Sixt <hidden>
Date: 2016-06-15 23:04:13

Am 20.03.2015 um 11:13 schrieb Jeff King:
quoted hunk ↗ jump to hunk
This script misses a trivial &&-chain in one of its tests,
but it also has a weird reverse: it includes an &&-chain
outside of any test_expect block! This "cat" should never
fail, but if it did, we would not notice, as it would cause
us to skip the follow-on test entirely (which does not
appear intentional; there are many later tests which rely on
this cat).

Let's instead move the setup into its own test_expect_success
block, which is the standard practice nowadays.

Signed-off-by: Jeff King <redacted>
---
  t/t9502-gitweb-standalone-parse-output.sh | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/t/t9502-gitweb-standalone-parse-output.sh b/t/t9502-gitweb-standalone-parse-output.sh
index 86dfee2..a93e159 100755
--- a/t/t9502-gitweb-standalone-parse-output.sh
+++ b/t/t9502-gitweb-standalone-parse-output.sh
@@ -145,9 +145,11 @@ test_expect_success 'forks: not skipped unless "forks" feature enabled' '
  	grep -q ">fork of .*<"           gitweb.body
  '

-cat >>gitweb_config.perl <<\EOF &&
-$feature{'forks'}{'default'} = [1];
-EOF
+test_expect_success 'enable forks feature' '
+	cat >>gitweb_config.perl <<-\EOF
+	$feature{'forks'}{'default'} = [1];
+	EOF
+'
This loses the single-quotes in the generated perl script, doesn't it? 
Most likely, it does not matter.

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help