summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/t/lib/feature/bits
blob: 227f852c2c645924513f284f71468240a0b1672f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Test specifically for things that cop_features broke

__END__
# NAME check clearing $^H clears the bits
use feature 'say';
BEGIN { %^H = () }
say "Fail";
EXPECT
String found where operator expected at - line 3, near "say "Fail""
	(Do you need to predeclare say?)
syntax error at - line 3, near "say "Fail""
Execution of - aborted due to compilation errors.
########
# NAME check copying $^H restores the bits
use feature 'say';
say "Hello";
BEGIN { our %work = %^H; }
no feature 'say';
BEGIN { %^H = our %work }
say "Goodbye";
EXPECT
Hello
Goodbye
########
# NAME check deleting entries (via feature.pm) clears the bits
use feature 'say';
say "Hello";
no feature 'say';
say "Goodbye";
EXPECT
String found where operator expected at - line 4, near "say "Goodbye""
	(Do you need to predeclare say?)
syntax error at - line 4, near "say "Goodbye""
Execution of - aborted due to compilation errors.
########
# NAME check deleting entries (bypass feature.pm) clears the bits
use feature 'say';
say "Hello";
BEGIN { delete $^H{feature_say}; }
say "Goodbye";
EXPECT
String found where operator expected at - line 4, near "say "Goodbye""
	(Do you need to predeclare say?)
syntax error at - line 4, near "say "Goodbye""
Execution of - aborted due to compilation errors.