File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 44# (only very basic at this point)
55
66use t::lib::PPI::Test::pragmas;
7- use Test::More tests => 13 + ($ENV {AUTHOR_TESTING } ? 1 : 0);
7+ use Test::More tests => 17 + ($ENV {AUTHOR_TESTING } ? 1 : 0);
88
99use File::Spec::Functions ' :ALL' ;
1010use PPI;
@@ -51,3 +51,13 @@ SCOPE: {
5151 is( $Normal1 -> equal( $Normal2 ), 1, ' ->equal returns true for equivalent code' );
5252 is( $Normal1 -> equal( $Normal3 ), ' ' , ' ->equal returns false for different code' );
5353}
54+
55+ NO_DOUBLE_REG: {
56+ sub just_a_test_sub { " meep" }
57+ ok( PPI::Normal-> register( " main::just_a_test_sub" , 2 ), " can add subs" );
58+ is $PPI::Normal::LAYER {2 }[-1], " main::just_a_test_sub" , " and find subs at right layer" ;
59+ my $size = @{ $PPI::Normal::LAYER {2 } };
60+ ok( PPI::Normal-> register( " main::just_a_test_sub" , 2 ), " can add subs again" );
61+ local $TODO = ' prevent duplicate registrations of normals' ;
62+ is scalar @{ $PPI::Normal::LAYER {2 } }, $size , " but sub isn't added twice" ;
63+ }
You can’t perform that action at this time.
0 commit comments