Re: [PATCH v2 05/12] t5520: test --rebase failure on unborn branch with index
- From
Paul Tan <pyokagan@gmail.com>
- Date
- May 7, 2015, 17:44 UTC
- Message-ID
- <CACRoPnQzAjY0bPmHrw2o4Mdzn1Q4Dd587hLXkEPA-qYcYrVGEg@mail.gmail.com>
- In-Reply-To
- <CAGZ79kY7gstS1xPcNu4HqmmXA+qg9BKpXZwaHeQ91n7vL2Sa-g@mail.gmail.com>
Hi,
On Fri, May 8, 2015 at 12:32 AM, Stefan Beller <sbeller@google.com> wrote:
Show 22 quoted lines
> On Thu, May 7, 2015 at 1:44 AM, Paul Tan <pyokagan@gmail.com> wrote: >> +test_expect_success 'pull --rebase fails on unborn branch with staged changes' ' >> + test_when_finished "rm -rf empty_repo2" && >> + git init empty_repo2 && >> + ( >> + cd empty_repo2 && >> + echo staged-file >staged-file && >> + git add staged-file && >> + test "$(git ls-files)" = staged-file && > > I think usually people use > > git ls-files >actual > echo staged-file >expected && # you have this already in your 2nd > # line in the paragraph > test_cmp staged-file actual > > to make debugging easier as you can inspect the files (actual, expected) > after the test has failed. > > Personally I don't mind the difference as when it comes to debugging > using the test suite I haven't found the silver bullet yet.
Ehh, but using test_cmp will litter the test with lots of "echo X
>expected" lines which I find quite distracting.
Just thinking aloud, but it would be great if there was a function to compare a string and a file, or a string and a string.
But yeah, I guess if the patches are verified to be correct, then I should change these comparisons to use test_cmp.
Thanks, Paul