You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use strict;
use warnings;
use Test::More import => [ qw( is ) ], tests => 3;
use Test::Warn qw( warning_like );
use Type::Params qw( signature );
use Types::Path::Tiny qw( File );
use Types::Standard qw( Str );
my $signature = signature( multiple => [ { positional => [ File ], }, { positional => [ Str ] } ] );
$signature->( __FILE__ );
is ${^_TYPE_PARAMS_MULTISIG}, 0, "is 'File'";
# https://perldoc.perl.org/perldiag#Unsuccessful-%25s-on-filename-containing-newline
warning_like { $signature->( "foo\n" ) } qr/\AUnsuccessful stat on filename containing newline/,
"stat() call raises diagnostic message as warning ('newline' category)";
is ${^_TYPE_PARAMS_MULTISIG}, 1, "is 'Str'";
The mutisig signature call raises a warning because I have passed the string "foo\n" that the File check gets applied to. I know that the Types::Path::Tiny types library isn't maintained by you but type checks in general could raise harmless warnings and I am asking for a configuration way to suppress them. I don't want to suppress all warnings but only warnings of certain categories?
The text was updated successfully, but these errors were encountered:
This is my use case
The
mutisig
signature call raises a warning because I have passed the string "foo\n" that theFile
check gets applied to. I know that theTypes::Path::Tiny
types library isn't maintained by you but type checks in general could raise harmless warnings and I am asking for a configuration way to suppress them. I don't want to suppress all warnings but only warnings of certain categories?The text was updated successfully, but these errors were encountered: