From: Junio C Hamano Date: Fri, 25 Oct 2019 06:18:25 GMT Subject: Re: [PATCH v3 2/3] t4203: Use test-lib.sh definitions Message-ID: In-Reply-To: <20191024233617.18716-3-prarit@redhat.com> Prarit Bhargava writes: > Use name and email definitions from test-lib.sh. > > Signed-off-by: Prarit Bhargava > --- > t/t4203-mailmap.sh | 94 +++++++++++++++++++++++----------------------- > 1 file changed, 47 insertions(+), 47 deletions(-) > > diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh > index 918ada69eb96..e8f9c0f5bc8c 100755 > --- a/t/t4203-mailmap.sh > +++ b/t/t4203-mailmap.sh > @@ -13,8 +13,8 @@ fuzz_blame () { > } > > test_expect_success setup ' > - cat >contacts <<-\EOF && > - A U Thor > + cat >contacts <<- EOF && > + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> > nick1 > EOF > > @@ -33,19 +33,19 @@ test_expect_success 'check-mailmap no arguments' ' > ' > > test_expect_success 'check-mailmap arguments' ' > - cat >expect <<-\EOF && > - A U Thor > + cat >expect <<- EOF && > + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> > nick1 > EOF > git check-mailmap \ > - "A U Thor " \ > + "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" \ > "nick1 " >actual && > test_cmp expect actual > ' > > test_expect_success 'check-mailmap --stdin' ' > - cat >expect <<-\EOF && > - A U Thor > + cat >expect <<- EOF && > + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> > nick1 > EOF > git check-mailmap --stdin actual && Strictly speaking, the above is different from the ones that appear in the rest of this patch and the ones in step 1/3. The reason why you need to expect "author@example.com" in the output of check-mailmap is only because the same hardcoded string is used in the setup step of this test. The remainder of this file and step 1/3 are quite different and are all good changes. The commit the data comes from gets created with the value that happens to be set to GIT_AUTHOR_NAME in test-lib---if the assigned value changes over there, the tests that expect hardcoded "author@example.com" would break, and that makes the step 1/3 and the remainder of this patch good changes. In any case, I think all of 1/3 and 2/3 taken together are good preparatory steps for 3/3. Thanks, will queue.