The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More tests => 1;
use Test::Deep;
use Test::MockObject;

use Parse::FieldPath qw/extract_fields/;

my $obj = Test::MockObject->new();
$obj->set_always( obj => $obj );
$obj->set_always( all_fields => ['obj'] );

eval { extract_fields($obj, 'obj') };
like($@, qr/maximum recursion limit reached/i, 'won\'t recurse forever');