Re: [PATCH 1/7] test: add merge style config test
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jun 10, 2021, 14:58 UTC
- Message-ID
- <bef8e373-20d8-3545-ba43-00108b2e77df@gmail.com>
- In-Reply-To
- <60c2130178831_b25b1208f5@natae.notmuch>
On 10/06/2021 14:26, Felipe Contreras wrote:
Show 31 quoted lines
> Phillip Wood wrote: >> On 09/06/2021 20:28, Felipe Contreras wrote: >>> We want to test different combinations of merge.conflictstyle, and a new >>> file is the best place to do that. >>[...] >>> diff --git a/t/t6440-config-conflict-markers.sh b/t/t6440-config-conflict-markers.sh >>> new file mode 100755 > >>> +test_expect_success 'merge' ' >>> + test_create_repo merge && >>> + ( >>> + cd merge && >>> + >>> + fill 1 2 3 >content && >>> + git add content && >>> + git commit -m base && >>> + >>> + git checkout -b r && >>> + echo six >>content && >>> + git commit -a -m right && >>> + >>> + git checkout master && >>> + echo 7 >>content && >>> + git commit -a -m left && >>> + >>> + test_must_fail git merge r && >>> + ! grep -E "\|+" content && >> >> ! grep "|" would be simpler and just as effective. > > But that would fail if there's a "command1 | command2".
I don't understand. What are you expecting content to contain? Why doesn't "\|+" fail in that case?
Show 5 quoted lines
>> This is quite a weak >> test, something like "^|||||| " would be a stronger test for conflict >> markers > > But that doesn't work in all the tests.
So test for what you actually expect, you don't need to have the same check in all the tests if the expected output is different.
Best Wishes
Phillip
> Cheers. >