File: bits

package info (click to toggle)
perl 5.42.0-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 128,392 kB
  • sloc: perl: 534,963; ansic: 240,563; sh: 72,042; pascal: 6,934; xml: 2,428; yacc: 1,360; makefile: 1,197; cpp: 208; lisp: 1
file content (42 lines) | stat: -rw-r--r-- 1,263 bytes parent folder | download | duplicates (2)
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.