From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff Hostetler <git@jeffhostetler.com>
Cc: Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>,
Jeff Hostetler <jeffhost@microsoft.com>
Subject: Re: [PATCH v8 1/2] json_writer: new routines to create data in JSON format
Date: Thu, 7 Jun 2018 13:24:26 -0400 [thread overview]
Message-ID: <CAPig+cRBCr2dKOBFnUF_D1SXfPTE5SPbB4t=y51VGa_jLQGkcA@mail.gmail.com> (raw)
In-Reply-To: <20180607141209.24423-2-git@jeffhostetler.com>
On Thu, Jun 7, 2018 at 10:12 AM, <git@jeffhostetler.com> wrote:
> Add a series of jw_ routines and "struct json_writer" structure to compose
> JSON data. The resulting string data can then be output by commands wanting
> to support a JSON output format.
> [...]
> Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
> ---
> diff --git a/t/t0019-json-writer.sh b/t/t0019-json-writer.sh
> @@ -0,0 +1,236 @@
> +test_expect_success 'simple object' '
> + cat >expect <<-\EOF &&
> + {"a":"abc","b":42,"c":3.14,"d":true,"e":false,"f":null}
> + EOF
> + test-json-writer >actual \
> + @object \
> + @object-string a abc \
> + @object-int b 42 \
> + @object-double c 2 3.140 \
> + @object-true d \
> + @object-false e \
> + @object-null f \
> + @end &&
> + test_cmp expect actual
> +'
To make it easier on people writing these tests, it might be nice for
this to be less noisy by getting rid of "@" and "\". To get rid of
"\", the test program could grab its script commands from stdin (one
instruction per line) rather than from argv[]. For instance:
test-json-writer >actual <<-\EOF &&
object
object-string a abc
...
end
EOF
Not a big deal, and certainly not worth a re-roll.
next prev parent reply other threads:[~2018-06-07 17:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-07 14:12 [PATCH v8 0/2] json-writer V8 git
2018-06-07 14:12 ` [PATCH v8 1/2] json_writer: new routines to create data in JSON format git
2018-06-07 17:24 ` Eric Sunshine [this message]
2018-06-08 20:17 ` Jeff Hostetler
2018-06-08 6:05 ` René Scharfe
2018-06-11 11:43 ` Jeff Hostetler
2018-06-08 20:07 ` René Scharfe
2018-06-11 11:51 ` Jeff Hostetler
2018-06-08 20:32 ` René Scharfe
2018-06-11 10:40 ` Jeff Hostetler
2018-06-07 14:12 ` [PATCH v8 2/2] json-writer: t0019: add perl unit test git
2018-06-07 17:13 ` Eric Sunshine
2018-06-11 12:16 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAPig+cRBCr2dKOBFnUF_D1SXfPTE5SPbB4t=y51VGa_jLQGkcA@mail.gmail.com' \
--to=sunshine@sunshineco.com \
--cc=git@jeffhostetler.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jeffhost@microsoft.com \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).