# [PATCH] t1410: use test_line_count

2 messages from 2019-11-26 to 2019-11-26. Participants: René Scharfe, Johannes Schindelin.
Thread: https://gitlist.dev/t/52349

## René Scharfe, 2019-11-26 18:21

Subject: [PATCH] t1410: use test_line_count
Message-ID: <5b872979-b29d-b120-870d-1cac807363ed@web.de>
URL: https://gitlist.dev/e/5b872979-b29d-b120-870d-1cac807363ed%40web.de

```
Use test_line_count to check if the number of lines matches
expectations, for improved consistency and nicer debug output.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 t/t1410-reflog.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
index 82950c0282..76d9b744a6 100755
--- a/t/t1410-reflog.sh
+++ b/t/t1410-reflog.sh
@@ -195,7 +195,7 @@ test_expect_success 'delete' '

 	git reflog delete master@{1} &&
 	git reflog show master > output &&
-	test $(($master_entry_count - 1)) = $(wc -l < output) &&
+	test_line_count = $(($master_entry_count - 1)) output &&
 	test $HEAD_entry_count = $(git reflog | wc -l) &&
 	! grep ox < output &&

@@ -209,7 +209,7 @@ test_expect_success 'delete' '

 	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
 	git reflog show master > output &&
-	test $(($master_entry_count - 1)) = $(wc -l < output) &&
+	test_line_count = $(($master_entry_count - 1)) output &&
 	! grep dragon < output

 '
--
2.24.0

```

## Johannes Schindelin, 2019-11-26 22:15

Subject: Re: [PATCH] t1410: use test_line_count
Message-ID: <nycvar.QRO.7.76.6.1911262315330.31080@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.1911262315330.31080%40tvgsbejvaqbjf.bet
In-Reply-To: <5b872979-b29d-b120-870d-1cac807363ed@web.de>

```
Hi René,

On Tue, 26 Nov 2019, René Scharfe wrote:

> Use test_line_count to check if the number of lines matches
> expectations, for improved consistency and nicer debug output.
>
> Signed-off-by: René Scharfe <l.s.r@web.de>

ACK!

Thanks,
Dscho

> ---
>  t/t1410-reflog.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/t1410-reflog.sh b/t/t1410-reflog.sh
> index 82950c0282..76d9b744a6 100755
> --- a/t/t1410-reflog.sh
> +++ b/t/t1410-reflog.sh
> @@ -195,7 +195,7 @@ test_expect_success 'delete' '
>
>  	git reflog delete master@{1} &&
>  	git reflog show master > output &&
> -	test $(($master_entry_count - 1)) = $(wc -l < output) &&
> +	test_line_count = $(($master_entry_count - 1)) output &&
>  	test $HEAD_entry_count = $(git reflog | wc -l) &&
>  	! grep ox < output &&
>
> @@ -209,7 +209,7 @@ test_expect_success 'delete' '
>
>  	git reflog delete master@{07.04.2005.15:15:00.-0700} &&
>  	git reflog show master > output &&
> -	test $(($master_entry_count - 1)) = $(wc -l < output) &&
> +	test_line_count = $(($master_entry_count - 1)) output &&
>  	! grep dragon < output
>
>  '
> --
> 2.24.0
>

```
