This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
bring '*' prototype closer to how it behaves internally
[perl5.git] / t / comp / use.t
CommitLineData
8ebc5c01 1#!./perl
2
3BEGIN {
4 chdir 't' if -d 't';
93430cb4 5 unshift @INC, '../lib';
8ebc5c01 6}
7
8print "1..14\n";
9
10my $i = 1;
11
12eval "use 5.000;";
13if ($@) {
14 print STDERR $@,"\n";
15 print "not ";
16}
17print "ok ",$i++,"\n";
18
19eval sprintf "use %.5f;", $];
20if ($@) {
21 print STDERR $@,"\n";
22 print "not ";
23}
24print "ok ",$i++,"\n";
25
26
27eval sprintf "use %.5f;", $] - 0.000001;
28if ($@) {
29 print STDERR $@,"\n";
30 print "not ";
31}
32print "ok ",$i++,"\n";
33
34eval sprintf("use %.5f;", $] + 1);
35unless ($@) {
36 print "not ";
37}
38print "ok ",$i++,"\n";
39
40eval sprintf "use %.5f;", $] + 0.00001;
41unless ($@) {
42 print "not ";
43}
44print "ok ",$i++,"\n";
45
46
47
48use lib; # I know that this module will be there.
49
50
51local $lib::VERSION = 1.0;
52
53eval "use lib 0.9";
54if ($@) {
55 print STDERR $@,"\n";
56 print "not ";
57}
58print "ok ",$i++,"\n";
59
60eval "use lib 1.0";
61if ($@) {
62 print STDERR $@,"\n";
63 print "not ";
64}
65print "ok ",$i++,"\n";
66
67eval "use lib 1.01";
68unless ($@) {
69 print "not ";
70}
71print "ok ",$i++,"\n";
72
73
74eval "use lib 0.9 qw(fred)";
75if ($@) {
76 print STDERR $@,"\n";
77 print "not ";
78}
79print "ok ",$i++,"\n";
80
81print "not " unless $INC[0] eq "fred";
82print "ok ",$i++,"\n";
83
84eval "use lib 1.0 qw(joe)";
85if ($@) {
86 print STDERR $@,"\n";
87 print "not ";
88}
89print "ok ",$i++,"\n";
90
91print "not " unless $INC[0] eq "joe";
92print "ok ",$i++,"\n";
93
94eval "use lib 1.01 qw(freda)";
95unless ($@) {
96 print "not ";
97}
98print "ok ",$i++,"\n";
99
100print "not " if $INC[0] eq "freda";
101print "ok ",$i++,"\n";