"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cpan/Scalar-List-Utils/t/readonly.t" between
perl-5.32.0-RC0.tar.xz and perl-5.32.0-RC1.tar.xz

About: Perl (Practical Extraction and Report Language) is a high-level, general-purpose, interpreted, dynamic programming language. Release candidate.

readonly.t  (perl-5.32.0-RC0.tar.xz):readonly.t  (perl-5.32.0-RC1.tar.xz)
#!./perl #!./perl
use strict; use strict;
use warnings; use warnings;
use Scalar::Util qw(readonly); use Scalar::Util qw(readonly);
use Test::More tests => 11; use Test::More tests => 11;
ok( readonly(1), 'number constant'); ok( readonly(1), 'number constant');
my $var = 2; my $var = 2;
ok( !readonly($var), 'number variable'); ok( !readonly($var), 'number variable');
is( $var, 2, 'no change to number variable'); is( $var, 2, 'no change to number variable');
ok( readonly("fred"), 'string constant'); ok( readonly("fred"), 'string constant');
$var = "fred"; $var = "fred";
ok( !readonly($var), 'string variable'); ok( !readonly($var), 'string variable');
is( $var, 'fred', 'no change to string variable'); is( $var, 'fred', 'no change to string variable');
$var = \2; $var = \2;
ok( !readonly($var), 'reference to constant'); ok( !readonly($var), 'reference to constant');
ok( readonly($$var), 'de-reference to constant'); ok( readonly($$var), 'de-reference to constant');
ok( !readonly(*STDOUT), 'glob'); ok( !readonly(*STDOUT), 'glob');
sub try sub try
{ {
my $v = \$_[0]; my $v = \$_[0];
return readonly $$v; return readonly $$v;
} }
$var = 123; $var = 123;
{ {
# This used not to work with ithreads, but seems to be working since 5.19.3 # This used not to work with ithreads, but seems to be working since 5.19.3
 End of changes. 6 change blocks. 
9 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)