git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix t4200-rerere for white-space from "wc -l"

From
Brian Gernhardt <benji@silverinsanity.com>
Date
Apr 4, 2007, 19:39 UTC
Message-ID
<20070404193905.GA23358@Hermes.local>

On OS X, wc outputs 6 spaces before the number of lines, so the test expecting the string "10" failed. Changing the test to use -eq for numerical equality ignores the problematic whitespace.

Also fix the grammar of the test name while making changes to it.
There's only one preimage, so it's "has", not "have".
---
 t/t4200-rerere.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh
index 8b611bb..cd939ac 100755
--- a/t/t4200-rerere.sh
+++ b/t/t4200-rerere.sh
@@ -50,10 +50,10 @@ test_expect_success 'recorded preimage' "grep ======= $rr/preimage"
 test_expect_success 'no postimage or thisimage yet' \
 	"test ! -f $rr/postimage -a ! -f $rr/thisimage"
 
-test_expect_success 'preimage have right number of lines' '
+test_expect_success 'preimage has right number of lines' '
 
 	cnt=$(sed -ne "/^<<<<<<</,/^>>>>>>>/p" $rr/preimage | wc -l) &&
-	test "$cnt" = 10
+	test "$cnt" -eq 10
 
 '
 
-- 
1.5.1.rc3.30.ga8f4
Message 1 of 1 in “Fix t4200-rerere for white-space from "wc -l"”
  1. Fix t4200-rerere for white-space from "wc -l"Brian Gernhardt, Apr 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.