diff options
| author | Lars Ingebrigtsen | 2019-08-23 04:49:52 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-08-23 04:49:52 +0200 |
| commit | 53cb3d3e0ddb666dc5b7774957ca863c668213cb (patch) | |
| tree | 011cf32acf25b0cd86debf5b3c22be289e60bd87 /test/src | |
| parent | b4d3a882a8423e81c418fc56b7a9677f5582fcc7 (diff) | |
| parent | 29d485fb768fbe375d60fd80cb2dbdbd90f3becc (diff) | |
| download | emacs-53cb3d3e0ddb666dc5b7774957ca863c668213cb.tar.gz emacs-53cb3d3e0ddb666dc5b7774957ca863c668213cb.zip | |
Merge remote-tracking branch 'origin/netsec'
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/process-tests.el | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 7745fccaf9d..724da1c3e72 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | ;;; Code: | 22 | ;;; Code: |
| 23 | 23 | ||
| 24 | (require 'ert) | 24 | (require 'ert) |
| 25 | (require 'puny) | ||
| 25 | 26 | ||
| 26 | ;; Timeout in seconds; the test fails if the timeout is reached. | 27 | ;; Timeout in seconds; the test fails if the timeout is reached. |
| 27 | (defvar process-test-sentinel-wait-timeout 2.0) | 28 | (defvar process-test-sentinel-wait-timeout 2.0) |
| @@ -322,5 +323,33 @@ See Bug#30460." | |||
| 322 | invocation-directory)) | 323 | invocation-directory)) |
| 323 | :stop t))) | 324 | :stop t))) |
| 324 | 325 | ||
| 326 | (ert-deftest lookup-family-specification () | ||
| 327 | "network-lookup-address-info should only accept valid family symbols." | ||
| 328 | (should-error (network-lookup-address-info "google.com" 'both)) | ||
| 329 | (should (network-lookup-address-info "google.com" 'ipv4)) | ||
| 330 | (should (network-lookup-address-info "google.com" 'ipv6))) | ||
| 331 | |||
| 332 | (ert-deftest lookup-unicode-domains () | ||
| 333 | "Unicode domains should fail" | ||
| 334 | (should-error (network-lookup-address-info "faß.de")) | ||
| 335 | (should (length (network-lookup-address-info (puny-encode-domain "faß.de"))))) | ||
| 336 | |||
| 337 | (ert-deftest unibyte-domain-name () | ||
| 338 | "Unibyte domain names should work" | ||
| 339 | (should (length (network-lookup-address-info (string-to-unibyte "google.com"))))) | ||
| 340 | |||
| 341 | (ert-deftest lookup-google () | ||
| 342 | "Check that we can look up google IP addresses" | ||
| 343 | (let ((addresses-both (network-lookup-address-info "google.com")) | ||
| 344 | (addresses-v4 (network-lookup-address-info "google.com" 'ipv4)) | ||
| 345 | (addresses-v6 (network-lookup-address-info "google.com" 'ipv6))) | ||
| 346 | (should (length addresses-both)) | ||
| 347 | (should (length addresses-v4)) | ||
| 348 | (should (length addresses-v6)))) | ||
| 349 | |||
| 350 | (ert-deftest non-existent-lookup-failure () | ||
| 351 | "Check that looking up non-existent domain returns nil" | ||
| 352 | (should (eq nil (network-lookup-address-info "emacs.invalid")))) | ||
| 353 | |||
| 325 | (provide 'process-tests) | 354 | (provide 'process-tests) |
| 326 | ;; process-tests.el ends here. | 355 | ;; process-tests.el ends here. |