From acfde2172e82f6b776f16d78f789c6968b69b9f0 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 5 Feb 2022 17:43:55 +0000 Subject: [PATCH] Testsuite: sort for "seen" hints DB dumps. Bug 2833 --- test/runtest | 12 +++++++++++- test/stdout/0626 | 4 ++-- 2 files changed, 13 insertions(+), 3 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 diff --git a/test/stdout/0626 b/test/stdout/0626 index 44b481f31..0c8ad3452 100644 --- a/test/stdout/0626 +++ b/test/stdout/0626 @@ -41,8 +41,8 @@ 550 Administrative prohibition 221 test.ex closing connection +++++++++++++++++++++++++++ -ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52 127.0.0.1 07-Mar-2000 12:21:52 +ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52 **** SMTP testing session as if from host 127.0.0.1 **** but without any ident (RFC 1413) callback. @@ -54,9 +54,9 @@ ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52 550 Administrative prohibition 221 test.ex closing connection +++++++++++++++++++++++++++ +127.0.0.1 07-Mar-2000 12:21:52 127.0.0.1_foo 07-Mar-2000 12:21:52 ip4.ip4.ip4.ip4 07-Mar-2000 12:21:52 -127.0.0.1 07-Mar-2000 12:21:52 **** SMTP testing session as if from host 127.0.0.1 **** but without any ident (RFC 1413) callback. -- 2.30.2