aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2021-02-26 19:54:59 +0100
committerAndrea Corallo2021-02-26 19:54:59 +0100
commit5c922cc3a4b0677805a678267df2b7598e92bb83 (patch)
treef7680e085436621332230c7a46df36ad4048310b /test/src
parentcedc55041ea5179dcb389845d2d0e3562060cab9 (diff)
parent496fa1c03b1b3ce4aa9872751e9fac45167766c2 (diff)
downloademacs-5c922cc3a4b0677805a678267df2b7598e92bb83.tar.gz
emacs-5c922cc3a4b0677805a678267df2b7598e92bb83.zip
Merge remote-tracking branch 'savannah/master' into native-comp
Diffstat (limited to 'test/src')
-rw-r--r--test/src/editfns-tests.el4
-rw-r--r--test/src/process-tests.el22
2 files changed, 19 insertions, 7 deletions
diff --git a/test/src/editfns-tests.el b/test/src/editfns-tests.el
index dcec971c12e..ea80da4819c 100644
--- a/test/src/editfns-tests.el
+++ b/test/src/editfns-tests.el
@@ -128,6 +128,10 @@
128 (format (concat "%-3d/" s) 12) 128 (format (concat "%-3d/" s) 12)
129 #("12 /X" 4 5 (prop "val")))))) 129 #("12 /X" 4 5 (prop "val"))))))
130 130
131(ert-deftest propertize/error-even-number-of-args ()
132 "Number of args for `propertize' must be odd."
133 (should-error (propertize "foo" 'bar) :type 'wrong-number-of-arguments))
134
131;; Tests for bug#5131. 135;; Tests for bug#5131.
132(defun transpose-test-reverse-word (start end) 136(defun transpose-test-reverse-word (start end)
133 "Reverse characters in a word by transposing pairs of characters." 137 "Reverse characters in a word by transposing pairs of characters."
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index e62bcb3f7c0..17aef30a433 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -348,8 +348,7 @@ See Bug#30460."
348 invocation-directory)) 348 invocation-directory))
349 :stop t)))) 349 :stop t))))
350 350
351;; All the following tests require working DNS, which appears not to 351;; The following tests require working DNS
352;; be the case for hydra.nixos.org, so disable them there for now.
353 352
354;; This will need updating when IANA assign more IPv6 global ranges. 353;; This will need updating when IANA assign more IPv6 global ranges.
355(defun ipv6-is-available () 354(defun ipv6-is-available ()
@@ -360,9 +359,16 @@ See Bug#30460."
360 (= (logand (aref elt 0) #xe000) #x2000))) 359 (= (logand (aref elt 0) #xe000) #x2000)))
361 (network-interface-list)))) 360 (network-interface-list))))
362 361
362;; Check if the Internet seems to be working. Mainly to pacify
363;; Debian's CI system.
364(defvar internet-is-working
365 (progn
366 (require 'dns)
367 (dns-query "google.com")))
368
363(ert-deftest lookup-family-specification () 369(ert-deftest lookup-family-specification ()
364 "`network-lookup-address-info' should only accept valid family symbols." 370 "`network-lookup-address-info' should only accept valid family symbols."
365 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 371 (skip-unless internet-is-working)
366 (with-timeout (60 (ert-fail "Test timed out")) 372 (with-timeout (60 (ert-fail "Test timed out"))
367 (should-error (network-lookup-address-info "localhost" 'both)) 373 (should-error (network-lookup-address-info "localhost" 'both))
368 (should (network-lookup-address-info "localhost" 'ipv4)) 374 (should (network-lookup-address-info "localhost" 'ipv4))
@@ -371,20 +377,20 @@ See Bug#30460."
371 377
372(ert-deftest lookup-unicode-domains () 378(ert-deftest lookup-unicode-domains ()
373 "Unicode domains should fail." 379 "Unicode domains should fail."
374 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 380 (skip-unless internet-is-working)
375 (with-timeout (60 (ert-fail "Test timed out")) 381 (with-timeout (60 (ert-fail "Test timed out"))
376 (should-error (network-lookup-address-info "faß.de")) 382 (should-error (network-lookup-address-info "faß.de"))
377 (should (network-lookup-address-info (puny-encode-domain "faß.de"))))) 383 (should (network-lookup-address-info (puny-encode-domain "faß.de")))))
378 384
379(ert-deftest unibyte-domain-name () 385(ert-deftest unibyte-domain-name ()
380 "Unibyte domain names should work." 386 "Unibyte domain names should work."
381 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 387 (skip-unless internet-is-working)
382 (with-timeout (60 (ert-fail "Test timed out")) 388 (with-timeout (60 (ert-fail "Test timed out"))
383 (should (network-lookup-address-info (string-to-unibyte "google.com"))))) 389 (should (network-lookup-address-info (string-to-unibyte "google.com")))))
384 390
385(ert-deftest lookup-google () 391(ert-deftest lookup-google ()
386 "Check that we can look up google IP addresses." 392 "Check that we can look up google IP addresses."
387 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 393 (skip-unless internet-is-working)
388 (with-timeout (60 (ert-fail "Test timed out")) 394 (with-timeout (60 (ert-fail "Test timed out"))
389 (let ((addresses-both (network-lookup-address-info "google.com")) 395 (let ((addresses-both (network-lookup-address-info "google.com"))
390 (addresses-v4 (network-lookup-address-info "google.com" 'ipv4))) 396 (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)))
@@ -396,10 +402,12 @@ See Bug#30460."
396 402
397(ert-deftest non-existent-lookup-failure () 403(ert-deftest non-existent-lookup-failure ()
398 "Check that looking up non-existent domain returns nil." 404 "Check that looking up non-existent domain returns nil."
399 (skip-unless (not (getenv "EMACS_HYDRA_CI"))) 405 (skip-unless internet-is-working)
400 (with-timeout (60 (ert-fail "Test timed out")) 406 (with-timeout (60 (ert-fail "Test timed out"))
401 (should (eq nil (network-lookup-address-info "emacs.invalid"))))) 407 (should (eq nil (network-lookup-address-info "emacs.invalid")))))
402 408
409;; End of tests requiring DNS
410
403(defmacro process-tests--ignore-EMFILE (&rest body) 411(defmacro process-tests--ignore-EMFILE (&rest body)
404 "Evaluate BODY, ignoring EMFILE errors." 412 "Evaluate BODY, ignoring EMFILE errors."
405 (declare (indent 0) (debug t)) 413 (declare (indent 0) (debug t))