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

RE: [PATCH v4] json_writer: new routines to create data in JSON format

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
Mar 27, 2018, 18:00 UTC
Message-ID
<007a01d3c5f5$7fcd3290$7f6797b0$@nexbridge.com>
In-Reply-To
<CAKk8isp5NncyDuGNhWctQfmjToWa8nAzHODi7SjbUW2i2R4kiw@mail.gmail.com>
On March 27, 2018 1:43 PM, Wink Saville wrote:
Show 8 quoted lines
> > the leading spaces are required in this case.
> > the pretty json output contains 8 spaces for that sub-structure not a tab.
> > is there a preferred way to denote this in the test script?
> >
> > Jeff
> 
> I've used "git diff --check" which I got from
> Documentation/SubmittingPatches.
While I have not done this in the git suite, my own suites use something along the lines of the following when I need (and have to validate) exact spacing at the beginning of lines in expected output:

cat <<-EOF | sed "1,\$s/_/ /g" >expect { level1 ... ________{ level2 Etc. EOF

Providing you don't use _ elsewhere in the output. It's a bit hacky but works.

Cheers, Randall

-- Brief whoami:
 NonStop developer since approximately 211288444200000000
 UNIX developer since approximately 421664400
-- In my real life, I talk too much.
Previous: Wink SavilleNext: Junio C Hamano
Message 8 of 14 in “routines to generate JSON data”
  1. routines to generate JSON datagit@jeffhostetler.com, Mar 26, 2018
  2. json_writer: new routines to create data in JSON formatgit@jeffhostetler.com, Mar 26, 2018
  3. Ramsay JonesMar 27, 2018
  4. Jeff HostetlerMar 27, 2018
  5. Ramsay JonesMar 27, 2018
  6. Jeff HostetlerMar 27, 2018
  7. Wink SavilleMar 27, 2018
  8. Randall S. BeckerMar 27, 2018
  9. Junio C HamanoMar 28, 2018
  10. Ramsay JonesMar 27, 2018
  11. Junio C HamanoMar 28, 2018
  12. Duy NguyenJun 2, 2018
  13. Jeff KingJun 2, 2018
  14. Jeff HostetlerJun 4, 2018

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.