From 00df039faa32a278029d1af27851e6fa15f4fb27 Mon Sep 17 00:00:00 2001 From: Christian Couder Date: Sun, 5 Nov 2017 22:38:32 +0100 Subject: [PATCH] t0021/rot13-filter: improve error message If there is no new line at the end of something it receives, the packet_txt_read() function die()s, but it's difficult to debug without much context. Let's give a bit more information when that happens. Signed-off-by: Christian Couder Signed-off-by: Junio C Hamano --- t/t0021/rot13-filter.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl index 37cecd865..f31ff595f 100644 --- a/t/t0021/rot13-filter.pl +++ b/t/t0021/rot13-filter.pl @@ -96,7 +96,8 @@ sub packet_bin_read { sub packet_txt_read { my ( $res, $buf ) = packet_bin_read(); unless ( $res == -1 or $buf eq '' or $buf =~ s/\n$// ) { - die "A non-binary line MUST be terminated by an LF."; + die "A non-binary line MUST be terminated by an LF.\n" + . "Received: '$buf'"; } return ( $res, $buf ); } -- 2.11.0