Jeff King wrote:
For small outputs, we sometimes use:
test $(some_cmd) = something we expect
instead of a full test_cmp. The downside of this is that
when it fails, there is no output at all from the script.
There's another downside to that construct: it loses the exit
status from
On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote:
Jeff King wrote:
For small outputs, we sometimes use:
test $(some_cmd) = something we expect
instead of a full test_cmp. The downside of this is that
when it fails, there is no output at all from the script.
Jeff King wrote:
On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote:
There's another downside to that construct: it loses the exit
status from some_cmd.
Yes, although I think in many cases it's not a big deal. For example,
here we lose the exit code of count-objects, but it
On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com wrote:
Jeff King wrote:
On Mon, Oct 13, 2014 at 09:10:22AM -0700, Jonathan Nieder wrote:
There's another downside to that construct: it loses the exit
status from some_cmd.
Yes, although I think in many cases it's not a big
On Mon, Oct 13, 2014 at 02:31:32PM -0700, Jonathan Nieder wrote:
One of my goals was to provide a more generic helper so that we don't
have to make little helpers like this for every command. So I'd much
rather something like:
test_output () {
printf %s\n $1 expect
shift
Junio C Hamano wrote:
On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com wrote:
It could segfault after producing the good output, but sure,
count-objects code doesn't change very often.
Doesn't change very often is not the issue. Here we are not testing
if it can count
Jonathan Nieder jrnie...@gmail.com writes:
Junio C Hamano wrote:
On Mon, Oct 13, 2014 at 2:31 PM, Jonathan Nieder jrnie...@gmail.com wrote:
It could segfault after producing the good output, but sure,
count-objects code doesn't change very often.
Doesn't change very often is not the issue.
For small outputs, we sometimes use:
test $(some_cmd) = something we expect
instead of a full test_cmp. The downside of this is that
when it fails, there is no output at all from the script.
Let's introduce a small helper to make tests easier to
debug.
Signed-off-by: Jeff King p...@peff.net
8 matches
Mail list logo