Commit | Line | Data |
---|---|---|
7a44ba35 TC |
1 | __END__ |
2 | # NAME OP_HELEM fields | |
3 | package Foo; | |
4 | use fields qw(a b); | |
5 | sub new { | |
6 | my $class = shift; | |
7 | return fields::new($class); | |
8 | } | |
9 | my Foo $f = Foo->new; | |
10 | $f->{c} = 1; | |
11 | EXPECT | |
12 | No such class field "c" in variable $f of type Foo at - line 8. | |
13 | ######## | |
14 | # NAME OP_HSLICE fields | |
15 | package Foo; | |
16 | use fields qw(a b); | |
17 | sub new { | |
18 | my $class = shift; | |
19 | return fields::new($class); | |
20 | } | |
21 | my Foo $f = Foo->new; | |
22 | @$f{"a", "c"} = ( 1, 2 ); | |
23 | EXPECT | |
24 | No such class field "c" in variable $f of type Foo at - line 8. | |
25 | ######## | |
26 | # NAME my sub | |
27 | my sub foo { } | |
28 | EXPECT | |
29 | "my sub" not yet implemented at - line 1. | |
30 | ######## | |
31 | # NAME delete BAD | |
32 | delete $x; | |
33 | EXPECT | |
34 | delete argument is not a HASH or ARRAY element or slice at - line 1. | |
35 | ######## | |
36 | # NAME exists BAD | |
37 | exists $x; | |
38 | EXPECT | |
39 | exists argument is not a HASH or ARRAY element or a subroutine at - line 1. | |
40 | ######## | |
41 | # NAME exists non-sub | |
42 | exists &foo() | |
43 | EXPECT | |
44 | exists argument is not a subroutine name at - line 1. |