From: Dragan Simic Date: Thu, 21 Mar 2024 05:01:37 GMT Subject: Re: [PATCH v4 3/4] t1300: add more tests for whitespace and inline comments Message-ID: <4c1d28fddc0e7277154cff51c0f0fde1@manjaro.org> In-Reply-To: On 2024-03-21 05:55, Eric Sunshine wrote: > On Thu, Mar 21, 2024 at 12:17 AM Dragan Simic > wrote: >> Add a handful of additional tests, to improve the coverage of the >> handling >> of configuration file entries whose values contain internal >> whitespace, >> leading and/or trailing whitespace, which may or may not be enclosed >> within >> quotation marks, or which contain an additional inline comment. >> >> At the same time, rework one already existing whitespace-related test >> a bit, >> to ensure its consistency with the newly added tests. This change >> introduced >> no functional changes to the already existing test. >> >> Helped-by: Eric Sunshine >> Helped-by: Junio C Hamano >> Signed-off-by: Dragan Simic >> --- >> diff --git a/t/t1300-config.sh b/t/t1300-config.sh >> @@ -11,6 +11,98 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME >> +test_expect_success 'setup whitespace config' ' >> + sed -e "s/^|//" \ >> + -e "s/[$]$//" \ >> + -e "s/X/\\t/g" >.git/config <<-\EOF > > Representing TAB as `\t` in the sed replacement is not necessarily > portable and (as far as I can see) we don't rely upon that in any > existing tests. It probably would be safer to employ a literal TAB > character in `s/X/ /g` as Junio showed in his example[1]. Hmm, I actually saw using a literal HT character as a disadvantage. Thanks for the notice, I'll send the v5 with this fixed. > [1]: https://lore.kernel.org/git/xmqqzfutjtfo.fsf@gitster.g/