blob: 3e5ae3c6490b4a77e0584d830766a7dd6cb6db85 (
plain)
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
|
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 (Do you need to predeclare "say"?) at - line 3, near "say "Fail""
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 (Do you need to predeclare "say"?) at - line 4, near "say "Goodbye""
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 (Do you need to predeclare "say"?) at - line 4, near "say "Goodbye""
syntax error at - line 4, near "say "Goodbye""
Execution of - aborted due to compilation errors.
|