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