From f5486c688dbc958a6b07f2db58d435a28583b433 Mon Sep 17 00:00:00 2001 From: Tom Wyant Date: Wed, 25 Oct 2023 12:06:28 -0400 Subject: [PATCH] Document that diag() returns false, and add 'return 0;' at its end as defensive programming (a.k.a. paranoia). --- lib/Test2/Tools/Basic.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Test2/Tools/Basic.pm b/lib/Test2/Tools/Basic.pm index e24e508c..006c67f3 100644 --- a/lib/Test2/Tools/Basic.pm +++ b/lib/Test2/Tools/Basic.pm @@ -41,6 +41,7 @@ sub diag { my $ctx = context(); $ctx->diag( join '', grep { defined $_ } @_ ); $ctx->release; + return 0; } sub note { @@ -248,6 +249,8 @@ Fire off a failing test (a single Ok event). The name and diagnostics are option Write diagnostics messages. All items in C<@messages> will be joined into a single string with no separator. When using TAP, diagnostics are sent to STDERR. +Returns false, so as to preserve failure. + =item note(@messages) Write note-diagnostics messages. All items in C<@messages> will be joined into