From 43d81ff8669c3705ca3c61270af4a5c7218c2fe6 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 4 Nov 2007 21:54:00 +0000 Subject: New special variable: .RECIPEPREFIX Allows the user to reset the prefix character for introducing recipe lines from the default (tab) to any other single character, and back again. Also, reworked the manual to consistently use the word "recipe" to describe the set of commands we use to update a target, instead of the various phrases used in the past: "commands", "command lines", "command scripts", etc. --- tests/test_driver.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'tests/test_driver.pl') diff --git a/tests/test_driver.pl b/tests/test_driver.pl index bea9816..dd30320 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -661,15 +661,23 @@ sub compare_output $answer_matched = 1; } else { # See if it is a slash or CRLF problem - local ($answer_mod) = $answer; + local ($answer_mod, $slurp_mod) = ($answer, $slurp); $answer_mod =~ tr,\\,/,; $answer_mod =~ s,\r\n,\n,gs; - $slurp =~ tr,\\,/,; - $slurp =~ s,\r\n,\n,gs; + $slurp_mod =~ tr,\\,/,; + $slurp_mod =~ s,\r\n,\n,gs; - $answer_matched = ($slurp eq $answer_mod); + $answer_matched = ($slurp_mod eq $answer_mod); + + # If it still doesn't match, see if the answer might be a regex. + if (!$answer_matched && $answer =~ m,^/(.+)/$,) { + $answer_matched = ($slurp =~ /$1/); + if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) { + $answer_matched = ($slurp_mod =~ /$1/); + } + } } if ($answer_matched && $test_passed) -- cgit v1.2.3