Skip to content

Commit 171d8c5

Browse files
committed
Address review comments
- Bump Perl version to v5.26 - Use 'my sub { }' syntax - Update unit test
1 parent 64c4770 commit 171d8c5

File tree

2 files changed

+36
-8
lines changed

2 files changed

+36
-8
lines changed

lib/Zonemaster/CLI.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Brief help module to define the exception we use for early exits.
22
package Zonemaster::Engine::Exception::NormalExit;
3-
use 5.014002;
3+
use v5.26;
44
use warnings;
55
use parent 'Zonemaster::Engine::Exception';
66

77
# The actual interesting module.
88
package Zonemaster::CLI;
99

10-
use 5.014002;
10+
use v5.26;
1111

1212
use strict;
1313
use warnings;
@@ -661,7 +661,7 @@ sub run {
661661
if ( $opt_json ) {
662662
my @times;
663663

664-
sub json_nstimes {
664+
my sub json_nstimes {
665665
my ( $ns ) = @_;
666666
return {
667667
'ns' => $ns->string,
@@ -698,7 +698,7 @@ sub run {
698698
my $total_queries_times = 0;
699699
my %nss_already_processed;
700700

701-
sub print_nstimes {
701+
my sub print_nstimes {
702702
my ( $ns, $max, $total_queries_count, $total_queries_times, $nss_already_processed_ref ) = @_;
703703
my %nss_already_processed = %{ $nss_already_processed_ref };
704704

t/usage.t

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,15 @@ do {
390390
text => qr{
391391
\QLooks OK.\E
392392
.*
393-
Server \s+ Max \s+ Min \s+ Avg \s+ Stddev \s+ Median \s+ Total
393+
\QName servers\E \s+ Max \s+ Min \s+ Avg \s+ Stddev \s+ Median \s+ Total \s+ Count
394394
.*
395-
\Qa.root-servers.net/\E
395+
\QChild zone\E
396+
.*
397+
\QParent zone\E
398+
.*
399+
Other
400+
.*
401+
\QGrand total\E \s+ \d+
396402
}msx,
397403
json => {
398404
type => "object",
@@ -401,8 +407,30 @@ do {
401407
nstimes => {
402408
type => "array",
403409
items => {
404-
type => "object",
405-
required => [qw( avg max median min ns stddev total)],
410+
type => "object",
411+
properties => {
412+
child => {
413+
type => "array",
414+
items => {
415+
type => "object",
416+
required => [qw( avg max median min ns stddev total count)],
417+
},
418+
},
419+
parent => {
420+
type => "array",
421+
items => {
422+
type => "object",
423+
required => [qw( avg max median min ns stddev total count)],
424+
},
425+
},
426+
other => {
427+
type => "array",
428+
items => {
429+
type => "object",
430+
required => [qw( avg max median min ns stddev total count)],
431+
},
432+
},
433+
},
406434
},
407435
},
408436
},

0 commit comments

Comments
 (0)