From: Jeff Hostetler Date: Wed, 20 Jul 2016 15:47:54 GMT Subject: Re: [PATCH v1 6/6] Unit tests for V2 porcelain status Message-ID: <578F9D2A.2030204@jeffhostetler.com> In-Reply-To: <578F9923.3000403@gmail.com> On 07/20/2016 11:30 AM, Jakub Narębski wrote: > W dniu 2016-07-20 o 00:10, Jeff Hostetler pisze: >> +test_expect_success pre_initial_commit_0 ' >> + printf "## branch: (initial) master\n" >expected && >> + printf "?? actual\n" >>expected && >> + printf "?? dir1/\n" >>expected && >> + printf "?? expected\n" >>expected && >> + printf "?? file_x\n" >>expected && >> + printf "?? file_y\n" >>expected && >> + printf "?? file_z\n" >>expected && > > Why not use heredoc syntax (cat <<\EOF), or prepare a file > with expected output in the testsuite? > The tests involving renames needed to embed a tab character in the output and hiding a tab character in a heredoc seemed error prone. So to be consistent I made them all printf-style. Also, some of the tests include SHAs for the commit and for file content, so having pre-computed expected output is awkward. Granted we could hard code the file SHAs, but not the commits. Jeff