Various buglets shaken out by -Mutf8.
[p5sagit/p5-mst-13.2.git] / t / lib / u-readonly.t
CommitLineData
f4a2945e 1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
6b05f64e 4 require Config; import Config;
5 if ($Config{extensions} !~ /\bList\/Util\b/) {
6 print "1..0 # Skip: List::Util was not built\n";
7 exit 0;
8 }
f4a2945e 9}
10
11use Scalar::Util qw(readonly);
12
13print "1..9\n";
14
15print "not " unless readonly(1);
16print "ok 1\n";
17
18my $var = 2;
19
20print "not " if readonly($var);
21print "ok 2\n";
22
23print "not " unless $var == 2;
24print "ok 3\n";
25
26print "not " unless readonly("fred");
27print "ok 4\n";
28
29$var = "fred";
30
31print "not " if readonly($var);
32print "ok 5\n";
33
34print "not " unless $var eq "fred";
35print "ok 6\n";
36
37$var = \2;
38
39print "not " if readonly($var);
40print "ok 7\n";
41
42print "not " unless readonly($$var);
43print "ok 8\n";
44
45print "not " if readonly(*STDOUT);
46print "ok 9\n";