skip quote-separator tests on newer perls that deprecate this behaviour
[p5sagit/Sub-Name.git] / t / quotes-bug.t
CommitLineData
4cd62f77 1use strict;
2use warnings;
3
a6602ad5 4use Test::More;
a31b59ba 5use if $ENV{AUTHOR_TESTING}, 'Test::Warnings';
4cd62f77 6use Sub::Name;
7
a6602ad5 8plan skip_all => 'single quote as a package separator has been removed'
9 if "$]" gt '5.041001';
10plan skip_all => 'single quote as a package separator has been deprecated'
11 if "$]" gt '5.037009';
12
4cd62f77 13my $sub = sub { (caller(0))[3] };
14subname "foo::quz'bar::baz", $sub;
15
16# in 0.16, this was foo::quz::ba::baz
17is(
18 $sub->(),
19 "foo::quz::bar::baz",
20 'correctly parsed single quote from name where the last separator is ::',
21);
a6602ad5 22
23done_testing;