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 <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Nov 5, 2017 at 22:38 UTC
00df039faa32a278029d1af27851e6fa15f4fb27
1 file changed
+2
-1
t/t0021/rot13-filter.pl
+2
-1
@@ -96,7 +96,8 @@ sub packet_bin_read {
96
sub packet_txt_read {
97
my ( $res, $buf ) = packet_bin_read();
98
unless ( $res == -1 or $buf eq '' or $buf =~ s/\n$// ) {
99
- die "A non-binary line MUST be terminated by an LF.";
99
+ die "A non-binary line MUST be terminated by an LF.\n"
100
+ . "Received: '$buf'";
101
}
102
return ( $res, $buf );
103
}