From: SZEDER Gábor Date: Thu, 31 Jan 2019 23:28:51 GMT Subject: Re: [PATCH v4 14/14] trace2: t/helper/test-trace2, t0210.sh, t0211.sh, t0212.sh Message-ID: <20190131232851.GD10587@szeder.dev> In-Reply-To: <8d47cd71ede3fd4e932e26756ef8f3f82b41d659.1548881779.git.gitgitgadget@gmail.com> On Wed, Jan 30, 2019 at 12:56:34PM -0800, Jeff Hostetler via GitGitGadget wrote: > Create unit tests for Trace2. > diff --git a/t/t0212-trace2-event.sh b/t/t0212-trace2-event.sh > new file mode 100755 > index 0000000000..517d5514df > --- /dev/null > +++ b/t/t0212-trace2-event.sh > @@ -0,0 +1,234 @@ > +test_expect_success 'event stream, return code 0' ' > + test_when_finished "rm trace.event actual expect" && > + GIT_TR2_EVENT="$(pwd)/trace.event" test-tool trace2 004child test-tool trace2 004child test-tool trace2 001return 0 && > + perl "$TEST_DIRECTORY/t0212/parse_events.perl" actual && > + sed -e "s/^|//" >expect <<-EOF && > + |VAR1 = { > + | "_SID0_":{ > + | "argv":[ > + | "_EXE_", > + | "trace2", > + | "004child", > + | "test-tool", > + | "trace2", > + | "004child", > + | "test-tool", > + | "trace2", > + | "001return", > + | "0" > + | ], > + | "child":{ > + | "0":{ > + | "child_argv":[ > + | "_EXE_", > + | "trace2", > + | "004child", > + | "test-tool", > + | "trace2", > + | "001return", > + | "0" > + | ], Just curious about the vertically aligned '|'s: are they there to circumvent 'git diff's big red whitespace warnings on these deeply indented lines?