]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/git.t: avoid passing read-only value to git_unquote
authorEric Wong <e@80x24.org>
Fri, 18 Jan 2019 19:40:07 +0000 (19:40 +0000)
committerEric Wong <e@80x24.org>
Fri, 18 Jan 2019 19:41:44 +0000 (19:41 +0000)
Older versions of Perl (tested 5.14.2 on Debian wheezy(*),
reported by Konstantin on Perl 5.16.3) considered the result of
concatenating two string literals to be a constant value.

(*) not that other stuff works on wheezy, but t/git.t should.

Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
t/git.t

diff --git a/t/git.t b/t/git.t
index 50ec4fbfc582d518986ad54f112ebca8f04a9451..052e1cece4b63c32b960c5c334876dd39ab0e399 100644 (file)
--- a/t/git.t
+++ b/t/git.t
@@ -145,7 +145,8 @@ if ('alternates reloaded') {
 }
 
 use_ok 'PublicInbox::Git', qw(git_unquote);
-is("foo\nbar", git_unquote('"foo\\nbar"'.''), 'unquoted newline');
-is("Eléanor", git_unquote('"El\\303\\251anor"'.''), 'unquoted octal');
+my $s;
+is("foo\nbar", git_unquote($s = '"foo\\nbar"'), 'unquoted newline');
+is("Eléanor", git_unquote($s = '"El\\303\\251anor"'), 'unquoted octal');
 
 done_testing();