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

Re: [PATCHv5 9/9] t3301: Modernize

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 12, 2014, 21:18 UTC
Message-ID
<xmqq389o3yop.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CALKQrgd-XzAhyZCADmQbCuUL6bdr1nrY8XACBb7UbEv9c=X3dQ@mail.gmail.com>
Johan Herland <johan@herland.net> writes:
Show 10 quoted lines
> On Wed, Nov 12, 2014 at 2:57 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> On Tue, Nov 11, 2014 at 7:40 PM, Johan Herland <johan@herland.net> wrote:
>>> +       test_line_count = 1 actual
>>
>> Broken &&-chain. This problem is repeated each place use invoke
>> test_line_count().
>
> Thanks. Fixed in the next iteration.
>
> ...Johan

Just FYI, here is what I came up with on top of 9/9 as 10/9, and it can be squashed in. If these will be the only differences between v5 and upcoming v6, you can just tell me to squash them together.

One unrelated changes is that '\'' is a bit shorter than '"'"' (and the four-letter sequence is idiomatic and easier to spot, once your eyes are used to reading strings in single-quote pairs).

Thanks.
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 861c159..245406a 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -53,7 +53,7 @@ test_expect_success 'create notes' '
 	MSG=b4 git notes add &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b4" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
@@ -67,7 +67,7 @@ test_expect_success 'show notes entry with %N' '
 
 test_expect_success 'create reflog entry' '
 	cat <<-EOF >expect &&
-		a1d8fa6 refs/notes/commits@{0}: notes: Notes added by '"'"'git notes add'"'"'
+		a1d8fa6 refs/notes/commits@{0}: notes: Notes added by '\''git notes add'\''
 	EOF
 	git reflog show refs/notes/commits >actual &&
 	test_cmp expect actual
@@ -77,7 +77,7 @@ test_expect_success 'edit existing notes' '
 	MSG=b3 git notes edit &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b3" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
@@ -87,7 +87,7 @@ test_expect_success 'cannot "git notes add -m" where notes already exists' '
 	test_must_fail git notes add -m "b2" &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b3" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
@@ -97,7 +97,7 @@ test_expect_success 'can overwrite existing note with "git notes add -f -m"' '
 	git notes add -f -m "b1" &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b1" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
@@ -107,7 +107,7 @@ test_expect_success 'add w/no options on existing note morphs into edit' '
 	MSG=b2 git notes add &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b2" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
@@ -117,7 +117,7 @@ test_expect_success 'can overwrite existing note with "git notes add -f"' '
 	MSG=b1 git notes add -f &&
 	test_path_is_missing .git/NOTES_EDITMSG &&
 	git ls-tree -r refs/notes/commits >actual &&
-	test_line_count = 1 actual
+	test_line_count = 1 actual &&
 	test "b1" = "$(git notes show)" &&
 	git show HEAD^ &&
 	test_must_fail git notes show HEAD^
-- 
2.2.0-rc1-84-gcd6439f
Previous: Johan HerlandNext: Johan Herland
Message 13 of 14 in “[PATCHv5 0/9] Handling empty notes”
  1. Johan HerlandNov 12, 2014
  2. 1/9 builtin/notes: Fix premature failure when trying to add the empty blobJohan Herland, Nov 12, 2014
  3. 2/9 t3301: Verify that 'git notes' removes empty notes by defaultJohan Herland, Nov 12, 2014
  4. 3/9 builtin/notes: Improve namingJohan Herland, Nov 12, 2014
  5. 4/9 builtin/notes: Refactor note file path into struct note_dataJohan Herland, Nov 12, 2014
  6. 5/9 builtin/notes: Simplify early exit code in add()Johan Herland, Nov 12, 2014
  7. 6/9 builtin/notes: Split create_note() to clarify add vs. remove logicJohan Herland, Nov 12, 2014
  8. 7/9 builtin/notes: Add --allow-empty, to allow storing empty notesJohan Herland, Nov 12, 2014
  9. 8/9 notes: Empty notes should be shown by 'git log'Johan Herland, Nov 12, 2014
  10. 9/9 t3301: ModernizeJohan Herland, Nov 12, 2014
  11. Eric SunshineNov 12, 2014
  12. Johan HerlandNov 12, 2014
  13. Junio C HamanoNov 12, 2014
  14. Johan HerlandNov 12, 2014

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.