This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.t: Add optional test name supplement
[perl5.git] / lib / locale.t
index 26a7bd4..e75087f 100644 (file)
@@ -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.