]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix echo-server-with-dns for really broken systems
authorRobert Pluim <rpluim@gmail.com>
Fri, 20 Jun 2025 09:57:41 +0000 (11:57 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 22 Jun 2025 08:08:57 +0000 (10:08 +0200)
*test/lisp/net/network-stream-tests.el
(network-test--resolve-system-name): Check to see if we get any
address result at all (looking at you macOS).

(cherry picked from commit dcead54ed54d14420f5cee10b0e4a24bba244722)

test/lisp/net/network-stream-tests.el

index 4762170bbbf510e83103bc942317929ee702eff6..1684900f7db14f1a90d83b5a03924bd3047caf94 100644 (file)
       ))))
 
 (defun network-test--resolve-system-name ()
-  (cl-loop for address in (network-lookup-address-info (system-name))
-           when (or (and (= (length address) 5)
-                         ;; IPv4 localhost addresses start with 127.
-                         (= (elt address 0) 127))
-                    (and (= (length address) 9)
-                         ;; IPv6 localhost address.
-                         (equal address [0 0 0 0 0 0 0 1 0])))
-           return t))
+  (let ((addresses (network-lookup-address-info (system-name))))
+    (if addresses
+        (cl-loop for address in (network-lookup-address-info (system-name))
+                 when (or (and (= (length address) 5)
+                               ;; IPv4 localhost addresses start with 127.
+                               (= (elt address 0) 127))
+                          (and (= (length address) 9)
+                               ;; IPv6 localhost address.
+                               (equal address [0 0 0 0 0 0 0 1 0])))
+                 return t)
+      t)))
 
 (ert-deftest echo-server-with-dns ()
   (skip-when (network-test--resolve-system-name))