1Check implicit loading of features with use VERSION.
2
3__END__
4# Standard feature bundle
5use feature ":5.10";
6say "Hello", "world";
7EXPECT
8Helloworld
9########
10# VERSION requirement, dotted notation
11use 5.9.5;
12say "Hello", "world";
13EXPECT
14Helloworld
15########
16# VERSION requirement, v-dotted notation
17use v5.9.5;
18say "Hello", "world";
19EXPECT
20Helloworld
21########
22# VERSION requirement, decimal notation
23use 5.009005;
24say "Helloworld";
25EXPECT
26Helloworld
27########
28# VERSION requirement, doesn't load anything with require
29require 5.9.5;
30print "<".$INC{"feature.pm"}.">\n";
31EXPECT
32<>
33########
34# VERSION requirement in eval {}
35eval {
36    use 5.9.5;
37    say "Hello", "world";
38}
39EXPECT
40Helloworld
41########
42# VERSION requirement in eval ""
43eval q{
44    use 5.9.5;
45    say "Hello", "world";
46}
47EXPECT
48Helloworld
49########
50# VERSION requirement in BEGIN
51BEGIN {
52    use 5.9.5;
53    say "Hello", "world";
54}
55EXPECT
56Helloworld
57########
58# no implicit features with 'no'
59eval "no " . ($]+1); print $@;
60EXPECT
61########
62# lower version after higher version
63sub evalbytes { print "evalbytes sub\n" }
64sub say { print "say sub\n" }
65use 5.015;
66evalbytes "say 'yes'";
67use 5.014;
68evalbytes;
69use 5;
70say "no"
71EXPECT
72yes
73evalbytes sub
74say sub
75########
76# Implicit unicode_string feature
77use v5.14;
78my $sharp_s = chr utf8::unicode_to_native(0xdf);
79print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n";
80use v5.8.8;
81print 'ss' =~ /$sharp_s/i ? "ok\n" : "nok\n";
82EXPECT
83ok
84nok
85########
86# Implicit unicode_eval feature
87use v5.15;
88require '../../t/charset_tools.pl';
89my $long_s = byte_utf8a_to_utf8n("\xc5\xbf");
90print eval "use utf8; q|$long_s|" eq $long_s ? "ok\n" : "nok\n";
91use v5.8.8;
92print eval "use utf8; q|$long_s|" eq "\x{17f}" ? "ok\n" : "nok\n";
93EXPECT
94ok
95ok
96