]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
test_common: only hide TCP port in messages
authorEric Wong <e@80x24.org>
Tue, 17 Oct 2023 23:38:05 +0000 (23:38 +0000)
committerEric Wong <e@80x24.org>
Wed, 18 Oct 2023 20:50:35 +0000 (20:50 +0000)
v2:// lei outputs are on the filesystem, so putting $HOST:$PORT
is nonsensical.  We'll also keep `127.0.0.1' or `[::1]' since
it's harmless and can point out obvious errors in system
configuration when testing with old Perls or libraries.

lib/PublicInbox/TestCommon.pm

index 3839ab4590fb4a8c0e1ef0d1b5b5cd983869ed8d..96663731d0f7329b0365dcb86375ec00670de195 100644 (file)
@@ -619,7 +619,7 @@ sub lei_ok (@) {
        my @msg = ref($_[0]) eq 'ARRAY' ? @{$_[0]} : @_;
        if (!$lei_loud) {
                for (@msg) {
-                       s!\A([a-z0-9]+://)[^/]+/!$1\$HOST_PORT/!;
+                       s!(127\.0\.0\.1|\[::1\]):(?:\d+)!$1:\$PORT!g;
                        s!$tmpdir\b/(?:[^/]+/)?!\$TMPDIR/!g;
                        s!\Q$PWD\E\b!\$PWD!g;
                }