From a9b7c63715bd82e15b815c96e5e1c6b87ab46f7b Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 6 Dec 2012 19:19:13 -0700 Subject: [PATCH] locale.t: Add optional test name supplement This allows tests to have extra stuff passed in that will be printed as part of the test results --- lib/locale.t | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/locale.t b/lib/locale.t index 26a7bd4..e75087f 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -89,12 +89,16 @@ sub is_tainted { # hello, camel two. not eval { $dummy = join("", @_), kill 0; 1 } } -sub check_taint ($) { - ok is_tainted($_[0]), "verify that is tainted"; +sub check_taint ($;$) { + my $message_tail = $_[1] // ""; + $message_tail = ": $message_tail" if $message_tail; + ok is_tainted($_[0]), "verify that is tainted$message_tail"; } -sub check_taint_not ($) { - ok((not is_tainted($_[0])), "verify that isn't tainted"); +sub check_taint_not ($;$) { + my $message_tail = $_[1] // ""; + $message_tail = ": $message_tail" if $message_tail; + ok((not is_tainted($_[0])), "verify that isn't tainted$message_tail"); } use locale; # engage locale and therefore locale taint. -- 2.7.4