Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-17 Thread Eric Sunshine
On Sun, Apr 17, 2016 at 11:19 AM, Johannes Sixt wrote: > Am 17.04.2016 um 05:07 schrieb Eric Sunshine: >> Hmm, considering that $(...) collapses each whitespace run (including >> newlines) down to a single space, I don't see how you could get a >> multi-line result. > > No, it

Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-17 Thread Johannes Sixt
Am 17.04.2016 um 05:07 schrieb Eric Sunshine: Hmm, considering that $(...) collapses each whitespace run (including newlines) down to a single space, I don't see how you could get a multi-line result. No, it doesn't. It only removes trailing newlines: ~:1004> frotz=$(echo 1; echo; echo 2;

Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-17 Thread Jeff King
On Sun, Apr 17, 2016 at 02:36:24AM -0400, Eric Sunshine wrote: > Agreed. I wouldn't mind the version where test_stdout grabs "expected" > from < prepared test_cmp version. > > I suppose that the one-liner form of test_stdout could

Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-17 Thread Eric Sunshine
On Sat, Apr 16, 2016 at 11:54 PM, Jeff King wrote: > On Sat, Apr 16, 2016 at 11:07:02PM -0400, Eric Sunshine wrote: >> > test_stdout accepts an expection and a command to execute. It will execute >> > the command and then compare the stdout from that command to an >> >

Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-16 Thread Jeff King
On Sat, Apr 16, 2016 at 11:07:02PM -0400, Eric Sunshine wrote: > > test_stdout accepts an expection and a command to execute. It will execute > > the command and then compare the stdout from that command to an expectation. > > If the expectation is not met, a mock diff output is written to

Re: [PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-16 Thread Eric Sunshine
On Sat, Apr 16, 2016 at 12:13 PM, Michael Rappazzo wrote: > test-lib: add a function to compare an expection with stdout from a command Rather long subject. Perhaps: test-lib: add convenience function to check command output > test_stdout accepts an expection and a

[PATCH v2 1/2] test-lib: add a function to compare an expection with stdout from a command

2016-04-16 Thread Michael Rappazzo
test_stdout accepts an expection and a command to execute. It will execute the command and then compare the stdout from that command to an expectation. If the expectation is not met, a mock diff output is written to stderr. Based-on-a-patch-by: Jeff King Signed-off-by: Michael