File: deep-recursion.t

package info (click to toggle)
libuniversal-can-perl 1.20140328-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 152 kB
  • sloc: perl: 326; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (5)
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
#! perl

# tests from RT #49580, where calling ->isa() may recurse into ->can()
package Test::Overloaded::String;

use strict;
use warnings;
use overload '""' => sub { $_[0]->can('bar') };

sub new { bless {}, shift }

sub bar {1}

1;

package main;

use strict;
use warnings;
use Test::More tests => 1;
use UNIVERSAL::can;

my $foo = Test::Overloaded::String->new;

ok( "$foo",  "Didn't segfault" );