Skip to content

Commit

Permalink
Make syntax04 take zone name instead of ns name
Browse files Browse the repository at this point in the history
  • Loading branch information
mattias-p committed Mar 4, 2024
1 parent b1d6f90 commit 757c417
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions lib/Zonemaster/Engine/Test/Syntax.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,8 @@ sub all {

if ( any { $_->tag eq q{ONLY_ALLOWED_CHARS} } @results ) {

foreach my $local_nsname ( uniq map { $_ } @{ Zonemaster::Engine::TestMethods->method2( $zone ) },
@{ Zonemaster::Engine::TestMethods->method3( $zone ) } )
{
push @results, $class->syntax04( Zonemaster::Engine->zone( $local_nsname ) )
if Zonemaster::Engine::Util::should_run_test( q{syntax04} );
}
push @results, $class->syntax04( Zonemaster::Engine->zone( $zone ) )
if Zonemaster::Engine::Util::should_run_test( q{syntax04} );

push @results, $class->syntax05( $zone ) if Zonemaster::Engine::Util::should_run_test( q{syntax05} );

Expand Down Expand Up @@ -818,9 +814,15 @@ sub syntax04 {
local $Zonemaster::Engine::Logger::TEST_CASE_NAME = 'Syntax04';
push my @results, _emit_log( TEST_CASE_START => { testcase => $Zonemaster::Engine::Logger::TEST_CASE_NAME } );

my $name = $zone->name;

push @results, _check_name_syntax( q{NAMESERVER}, $name );
foreach my $local_nsname (
uniq(
@{ Zonemaster::Engine::TestMethods->method2( $zone ) },
@{ Zonemaster::Engine::TestMethods->method3( $zone ) }
)
)
{
push @results, _check_name_syntax( q{NAMESERVER}, $zone->name );
}

return ( @results, _emit_log( TEST_CASE_END => { testcase => $Zonemaster::Engine::Logger::TEST_CASE_NAME } ) );
}
Expand Down

0 comments on commit 757c417

Please sign in to comment.