git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Randall S. Becker" <rsbecker@nexbridge.com>
To: "'Wink Saville'" <wink@saville.com>,
	"'Jeff Hostetler'" <git@jeffhostetler.com>
Cc: "'Ramsay Jones'" <ramsay@ramsayjones.plus.com>,
	"'Git List'" <git@vger.kernel.org>,
	"'Junio C Hamano'" <gitster@pobox.com>, <peff@peff.net>,
	<l.s.r@web.de>, "'Jeff Hostetler'" <jeffhost@microsoft.com>
Subject: RE: [PATCH v4] json_writer: new routines to create data in JSON format
Date: Tue, 27 Mar 2018 14:00:27 -0400	[thread overview]
Message-ID: <007a01d3c5f5$7fcd3290$7f6797b0$@nexbridge.com> (raw)
In-Reply-To: <CAKk8isp5NncyDuGNhWctQfmjToWa8nAzHODi7SjbUW2i2R4kiw@mail.gmail.com>

On March 27, 2018 1:43 PM, Wink Saville wrote:
> > 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.





  reply	other threads:[~2018-03-27 18:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-26 14:31 [PATCH v4] routines to generate JSON data git
2018-03-26 14:31 ` [PATCH v4] json_writer: new routines to create data in JSON format git
2018-03-27  3:18   ` Ramsay Jones
2018-03-27 10:28     ` Jeff Hostetler
2018-03-27 15:45     ` Ramsay Jones
2018-03-27 17:14       ` Jeff Hostetler
2018-03-27 17:43         ` Wink Saville
2018-03-27 18:00           ` Randall S. Becker [this message]
2018-03-28  5:22             ` Junio C Hamano
2018-03-27 18:05         ` Ramsay Jones
2018-03-28  1:22       ` Junio C Hamano
2018-06-02  4:41   ` Duy Nguyen
2018-06-02  5:13     ` Jeff King
2018-06-04  9:41       ` Jeff Hostetler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='007a01d3c5f5$7fcd3290$7f6797b0$@nexbridge.com' \
    --to=rsbecker@nexbridge.com \
    --cc=git@jeffhostetler.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=l.s.r@web.de \
    --cc=peff@peff.net \
    --cc=ramsay@ramsayjones.plus.com \
    --cc=wink@saville.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).