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

Re: [PATCH v4 3/3] t4113: put executable lines to test_expect_success

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 7, 2023, 08:05 UTC
Message-ID
<230207.86h6vx51x3.gmgdl@evledraar.gmail.com>
In-Reply-To
<CAMO4yUGmQ371hLCSTODQct+CzY2mqywfLzZO6fsgqN2=1cWGrw@mail.gmail.com>
On Mon, Feb 06 2023, Shuqi Liang wrote:
Show 56 quoted lines
> On Mon, Feb 6, 2023 at 5:44 PM Junio C Hamano <gitster@pobox.com> wrote:
>
>> Have you run the resulting test?
>
> My apologies for not testing after V1. That was a major oversight on
> my part.  I'll make sure to thoroughly test before each submission to
> avoid any issues with the code in the future.
>
>
>> This creates a "test-patch" file with lines 'a' and 'b' that are
>> common context lines without any whitespace before them, no?  The
>> original left the necessary single space in front of them (see the
>> line removed above).
>
> I try to change the code to(left the necessary single space in front
> of 'a' and 'b':
>
> diff --git a/t/t4113-apply-ending.sh b/t/t4113-apply-ending.sh
> index ab5ecaab7f..ef61a3187c 100755
> --- a/t/t4113-apply-ending.sh
> +++ b/t/t4113-apply-ending.sh
> @@ -14,8 +14,8 @@ test_expect_success setup '
> --- a/file
> +++ b/file
> @@ -1,2 +1,3 @@
> - a
> - b
> + a
> + b
> +c
> EOF
>
> Here I only show one part ,but I fix two same issue in the V4 patch
> and it still can not pass the test .
> It say :
>
> Test Summary Report
>
> -------------------
>
> t4113-apply-ending.sh (Wstat: 256 Tests: 0 Failed: 0)
>
>   Non-zero exit status: 1
>
>   Parse errors: No plan found in TAP output
>
> Files=1, Tests=0,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.05 cusr
> 0.02 csys =  0.09 CPU)
>
> Result: FAIL.
>
> I'm stumped as to why it's still failing. I've tried searching for
> answers on StackOverflow, but I still can't figure it out.
> ----------------
> Thanks,
> Shuqi

The error doesn't tell us much, instead of "make prove" or "prove <name>" running e.g.:

	./t4113-apply-ending.sh -vixd
Gives you better output.

But this is almost certainly that you're trying to insert leading whitespace into a line that's in a <<-EOF here-doc, the "-" part of that means that your leading whitespace is being stripped.

A typical idiom for that is have a marker for the start of line, and strip the whitespace with "sed". See this for existing examples:

	git grep 'sed.*\^.*>.*EOF'
Previous: Shuqi LiangNext: Shuqi Liang
Message 28 of 49 in “t/t4113-apply-ending.sh: Modernize a test script”
  1. Shuqi LiangJan 31, 2023
  2. Andrei RybakFeb 1, 2023
  3. cheska franFeb 2, 2023
  4. 0/4 t4113: modernize test styleShuqi Liang, Feb 2, 2023
  5. 1/4 t4113: replace backslash with single quoteShuqi Liang, Feb 2, 2023
  6. Junio C HamanoFeb 2, 2023
  7. Shuqi LiangFeb 5, 2023
  8. 2/4 t4113:put second creation in own stepShuqi Liang, Feb 2, 2023
  9. 3/4 t4113: use "<<-" instead of "<<"Shuqi Liang, Feb 2, 2023
  10. Junio C HamanoFeb 2, 2023
  11. Shuqi LiangFeb 5, 2023
  12. 4/4 t4113: indent with tabsShuqi Liang, Feb 2, 2023
  13. Junio C HamanoFeb 2, 2023
  14. Shuqi LiangFeb 5, 2023
  15. 0/3 modernize styleShuqi Liang, Feb 5, 2023
  16. 1/3 t4113: modernize a test scriptShuqi Liang, Feb 5, 2023
  17. 2/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 5, 2023
  18. 3/3 t4113: indent with spaceShuqi Liang, Feb 5, 2023
  19. Eric SunshineFeb 5, 2023
  20. Shuqi LiangFeb 6, 2023
  21. 0/3 t4113: modernize styleShuqi Liang, Feb 6, 2023
  22. 1/3 t4113: modernize test scriptShuqi Liang, Feb 6, 2023
  23. 2/3 t4113: indent with tabShuqi Liang, Feb 6, 2023
  24. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 6, 2023
  25. Ævar Arnfjörð BjarmasonFeb 6, 2023
  26. Junio C HamanoFeb 6, 2023
  27. Shuqi LiangFeb 6, 2023
  28. Ævar Arnfjörð BjarmasonFeb 7, 2023
  29. Shuqi LiangFeb 7, 2023
  30. Shuqi LiangFeb 8, 2023
  31. Ævar Arnfjörð BjarmasonFeb 8, 2023
  32. Shuqi LiangFeb 10, 2023
  33. Eric SunshineFeb 15, 2023
  34. Eric SunshineFeb 15, 2023
  35. Shuqi LiangFeb 14, 2023
  36. Junio C HamanoFeb 14, 2023
  37. 0/3 t4113: modernize styleShuqi Liang, Feb 9, 2023
  38. 1/3 t4113: modernize test scriptShuqi Liang, Feb 9, 2023
  39. 2/3 t4113: indent with tabShuqi Liang, Feb 9, 2023
  40. Eric SunshineFeb 15, 2023
  41. Shuqi LiangFeb 15, 2023
  42. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 9, 2023
  43. Eric SunshineFeb 15, 2023
  44. Shuqi LiangFeb 15, 2023
  45. 0/3 t4113: modernize styleShuqi Liang, Feb 15, 2023
  46. 0/3 t4113: modernize styleShuqi Liang, Feb 15, 2023
  47. 1/3 t4113: modernize test scriptShuqi Liang, Feb 15, 2023
  48. 2/3 t4113: indent with tabShuqi Liang, Feb 15, 2023
  49. 3/3 t4113: put executable lines to test_expect_successShuqi Liang, Feb 15, 2023

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.