t9700: fix test for perl older than 5.14
commit839b6397be260592f5afd193279c5dbfb99ce093
authorJeff King <peff@peff.net>
Fri, 4 Mar 2016 11:43:21 +0000 (4 06:43 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 4 Mar 2016 18:14:30 +0000 (4 10:14 -0800)
tree0fca3579e2cd1ecfe3eb93fa9ebe6c8a10e8e25c
parent80ce6c25a4289835e197004a54ca75401bea55dc
t9700: fix test for perl older than 5.14

Commit d53c2c6 (mingw: fix t9700's assumption about
directory separators, 2016-01-27) uses perl's "/r" regex
modifier to do a non-destructive replacement on a string,
leaving the original unmodified and returning the result.

This feature was introduced in perl 5.14, but systems with
older perl are still common (e.g., CentOS 6.5 still has perl
5.10). Let's work around it by providing a helper function
that does the same thing using older syntax.

While we're at it, let's switch to using an alternate regex
separator, which is slightly more readable.

Reported-by: Christian Couder <christian.couder@gmail.com>
Helped-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9700/test.pl