xref: /openbsd-src/gnu/usr.bin/perl/t/lib/feature/bits (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
1Test specifically for things that cop_features broke
2
3__END__
4# NAME check clearing $^H clears the bits
5use feature 'say';
6BEGIN { %^H = () }
7say "Fail";
8EXPECT
9String found where operator expected (Do you need to predeclare "say"?) at - line 3, near "say "Fail""
10syntax error at - line 3, near "say "Fail""
11Execution of - aborted due to compilation errors.
12########
13# NAME check copying $^H restores the bits
14use feature 'say';
15say "Hello";
16BEGIN { our %work = %^H; }
17no feature 'say';
18BEGIN { %^H = our %work }
19say "Goodbye";
20EXPECT
21Hello
22Goodbye
23########
24# NAME check deleting entries (via feature.pm) clears the bits
25use feature 'say';
26say "Hello";
27no feature 'say';
28say "Goodbye";
29EXPECT
30String found where operator expected (Do you need to predeclare "say"?) at - line 4, near "say "Goodbye""
31syntax error at - line 4, near "say "Goodbye""
32Execution of - aborted due to compilation errors.
33########
34# NAME check deleting entries (bypass feature.pm) clears the bits
35use feature 'say';
36say "Hello";
37BEGIN { delete $^H{feature_say}; }
38say "Goodbye";
39EXPECT
40String found where operator expected (Do you need to predeclare "say"?) at - line 4, near "say "Goodbye""
41syntax error at - line 4, near "say "Goodbye""
42Execution of - aborted due to compilation errors.
43