diff mbox series

[1/2] diff tests: remove redundant case statement

Message ID patch-1.2-35e77153831-20210413T122645Z-avarab@gmail.com (mailing list archive)
State New
Headers show
Series diff tests: un-flaky and post-gettext-poison cleanup | expand

Commit Message

Ævar Arnfjörð Bjarmason April 13, 2021, 12:28 p.m. UTC
Remove a case statement whose two arms executed the same code. This
was added for i18n testing in 6dd88832e77 (diffstat summary line
varies by locale: miscellany, 2012-03-13), and was changed from
test_i18ncmp in my 1108cea7f8e (tests: remove most uses of
test_i18ncmp, 2021-02-11).

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t4013-diff-various.sh | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Matheus Tavares Bernardino April 13, 2021, 2:18 p.m. UTC | #1
On Tue, Apr 13, 2021 at 9:31 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
> index 6cca8b84a6b..67f6411aff9 100755
> --- a/t/t4013-diff-various.sh
> +++ b/t/t4013-diff-various.sh
> @@ -220,13 +220,7 @@ do
>                 then
>                         process_diffs "$actual" >actual &&
>                         process_diffs "$expect" >expect &&
> -                       case $cmd in
> -                       *format-patch* | *-stat*)
> -                               test_cmp expect actual;;
> -                       *)
> -                               test_cmp expect actual;;
> -                       esac &&
> -                       rm -f "$actual" actual expect

Was this line removed by accident? It doesn't seem related to the
described change. Shouldn't this line be left after...

> +                       test_cmp expect actual

...this one?

>                 else
>                         # this is to help developing new tests.
>                         cp "$actual" "$expect"
> --
> 2.31.1.646.g06d606cb9c7
>
Ævar Arnfjörð Bjarmason April 13, 2021, 2:23 p.m. UTC | #2
On Tue, Apr 13 2021, Matheus Tavares Bernardino wrote:

> On Tue, Apr 13, 2021 at 9:31 AM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>>
>> diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
>> index 6cca8b84a6b..67f6411aff9 100755
>> --- a/t/t4013-diff-various.sh
>> +++ b/t/t4013-diff-various.sh
>> @@ -220,13 +220,7 @@ do
>>                 then
>>                         process_diffs "$actual" >actual &&
>>                         process_diffs "$expect" >expect &&
>> -                       case $cmd in
>> -                       *format-patch* | *-stat*)
>> -                               test_cmp expect actual;;
>> -                       *)
>> -                               test_cmp expect actual;;
>> -                       esac &&
>> -                       rm -f "$actual" actual expect
>
> Was this line removed by accident? It doesn't seem related to the
> described change. Shouldn't this line be left after...
>
>> +                       test_cmp expect actual
>
> ...this one?

Yes, it should be in 2/2 where this gets turned into a
test_when_finished "rm [...]", sorry.
diff mbox series

Patch

diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh
index 6cca8b84a6b..67f6411aff9 100755
--- a/t/t4013-diff-various.sh
+++ b/t/t4013-diff-various.sh
@@ -220,13 +220,7 @@  do
 		then
 			process_diffs "$actual" >actual &&
 			process_diffs "$expect" >expect &&
-			case $cmd in
-			*format-patch* | *-stat*)
-				test_cmp expect actual;;
-			*)
-				test_cmp expect actual;;
-			esac &&
-			rm -f "$actual" actual expect
+			test_cmp expect actual
 		else
 			# this is to help developing new tests.
 			cp "$actual" "$expect"