diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2022-02-05 17:43:55 +0000 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2022-02-05 17:47:34 +0000 |
commit | acfde2172e82f6b776f16d78f789c6968b69b9f0 (patch) | |
tree | b508322f5606e43032240ff031fed74281237ad3 /test/runtest | |
parent | b07d141af23f2ab160eba2b58a834baee513b3f8 (diff) |
Testsuite: sort for "seen" hints DB dumps. Bug 2833
Diffstat (limited to 'test/runtest')
-rwxr-xr-x | test/runtest | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/runtest b/test/runtest index ede05bea8..8e3a1f42c 100755 --- a/test/runtest +++ b/test/runtest @@ -2316,7 +2316,7 @@ if (/^dump\s+(\S+)/) sort { $a->[0] cmp $b->[0] } #map { [ (split)[0] =~ s/\Q$parm_ipv4/ip4.ip4.ip4.ip4/gr, $_ ] } # this is too modern for 5.10.1 map { - (my $k = (split)[0]) =~ s/\Q$parm_ipv4/ip4.ip4.ip4.ip4/g; + (my $k = (split)[0]) =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/g; [ $k, $_ ] } do { local $/ = "\n "; <$in> }; @@ -2337,6 +2337,16 @@ if (/^dump\s+(\S+)/) return $aa cmp $bb; } @temp; } + elsif ($which eq "seen") + { + @temp = sort { + (my $aa = $a) =~ s/^([\d.]+)/$1/; + (my $bb = $b) =~ s/^([\d.]+)/$1/; + $aa =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/; + $bb =~ s/\Q$parm_ipv4\E/ip4.ip4.ip4.ip4/; + return $aa cmp $bb; + } @temp; + } print $out @temp; } close($in); # close it explicitly, otherwise $? does not get set |