Skip to content

Commit beb2f63

Browse files
1-1samkhwilliamson
authored andcommitted
todo test for GH 2027 (Code blessed where it shouldn't)
This commit adds a todo test for GH 2027 which tests that perl does not re-use the same subroutine reference when passing distinct subs to a function.
1 parent 079dff6 commit beb2f63

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t/run/todo.t

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,19 @@ TODO: {
130130

131131
}
132132

133+
TODO: {
134+
local $::TODO = 'GH 2027';
135+
my sub new {
136+
my ($class, $code) = @_;
137+
return bless $code => $class;
138+
}
139+
my @codes;
140+
for my $i (1 .. 2) {
141+
push @codes, new('main', sub {});
142+
}
143+
isnt($codes[0], $codes[1], 'The same subroutine reference is not re-used when blessed; GH 2027');
144+
}
145+
133146
TODO: {
134147
local $::TODO = 'GH 5835';
135148
my $prev_w = $^W;

0 commit comments

Comments
 (0)