aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMattias EngdegÄrd2022-04-11 16:22:38 +0200
committerMattias EngdegÄrd2022-04-11 16:29:24 +0200
commit26db1ca80e459a640cc6648fb7f94c873def3ddd (patch)
treea369bdcd5d121dd2740b7d9764be2390332e5f58 /test
parenta715f2fbe70bb4cbb961e82af95e2965030b4513 (diff)
downloademacs-26db1ca80e459a640cc6648fb7f94c873def3ddd.tar.gz
emacs-26db1ca80e459a640cc6648fb7f94c873def3ddd.zip
Recognise hybrid IPv6/IPv4 addresses in textsec (bug#54624)
* lisp/international/textsec.el (textsec--ipvx-address-p): Recognise hybrid addresses like "::ffff:129.55.2.201". Combine to a single regexp and translate to rx. Remove some regexp ambiguity (relint complaint). * test/lisp/international/textsec-tests.el (test-suspiction-domain): Add test cases.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/international/textsec-tests.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/lisp/international/textsec-tests.el b/test/lisp/international/textsec-tests.el
index 9216d334f87..6b0773dc407 100644
--- a/test/lisp/international/textsec-tests.el
+++ b/test/lisp/international/textsec-tests.el
@@ -126,7 +126,10 @@
126 (should-not (textsec-domain-suspicious-p 126 (should-not (textsec-domain-suspicious-p
127 "[21a:34aa:c782:3ad2:1bf8:73f8:141:66e8]")) 127 "[21a:34aa:c782:3ad2:1bf8:73f8:141:66e8]"))
128 (should (textsec-domain-suspicious-p 128 (should (textsec-domain-suspicious-p
129 "[21a:34aa:c782:3ad2:1bf8:73f8:141:66e8"))) 129 "[21a:34aa:c782:3ad2:1bf8:73f8:141:66e8"))
130 (should-not (textsec-domain-suspicious-p "138.25.106.12"))
131 (should-not (textsec-domain-suspicious-p "2001:db8::ff00:42:8329"))
132 (should-not (textsec-domain-suspicious-p "::ffff:129.55.2.201")))
130 133
131(ert-deftest test-suspicious-local () 134(ert-deftest test-suspicious-local ()
132 (should-not (textsec-local-address-suspicious-p "larsi")) 135 (should-not (textsec-local-address-suspicious-p "larsi"))