Re: A new PerlIO coredump
[p5sagit/p5-mst-13.2.git] / t / lib / u-readonly.t
CommitLineData
f4a2945e 1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
4}
5
6use Scalar::Util qw(readonly);
7
8print "1..9\n";
9
10print "not " unless readonly(1);
11print "ok 1\n";
12
13my $var = 2;
14
15print "not " if readonly($var);
16print "ok 2\n";
17
18print "not " unless $var == 2;
19print "ok 3\n";
20
21print "not " unless readonly("fred");
22print "ok 4\n";
23
24$var = "fred";
25
26print "not " if readonly($var);
27print "ok 5\n";
28
29print "not " unless $var eq "fred";
30print "ok 6\n";
31
32$var = \2;
33
34print "not " if readonly($var);
35print "ok 7\n";
36
37print "not " unless readonly($$var);
38print "ok 8\n";
39
40print "not " if readonly(*STDOUT);
41print "ok 9\n";