summaryrefslogtreecommitdiff
path: root/test/lisp/thingatpt-tests.el
diff options
context:
space:
mode:
authorF. Jason Park <jp@neverwas.me>2022-07-13 01:54:19 -0700
committerF. Jason Park <jp@neverwas.me>2022-11-09 05:15:11 -0800
commit4bd5ac04a3b11228c8b7a9c7144503267bb8b9b4 (patch)
treee4ec2a92d30a23135b23e2c425d46c8f1ffbc11d /test/lisp/thingatpt-tests.el
parentb7e476a3d3023ab954939a68f326616ab970ddda (diff)
downloademacs-4bd5ac04a3b11228c8b7a9c7144503267bb8b9b4.tar.gz
Teach thing-at-point to recognize bracketed IPv6 URLs
* lisp/thingatpt.el (thing-at-point-bounds-of-url-at-point): Allow IPv6 addresses as hosts. Overshoots in the case of bracketed markup but is rescued by `thing-at-point--bounds-of-well-formed-url'. * test/lisp/thingatpt-tests.el (thing-at-point-test-data): Add cases for IPv6 URLs. Bug#56514.
Diffstat (limited to 'test/lisp/thingatpt-tests.el')
-rw-r--r--test/lisp/thingatpt-tests.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el
index b6d0b1446a3..67dd00104b0 100644
--- a/test/lisp/thingatpt-tests.el
+++ b/test/lisp/thingatpt-tests.el
@@ -44,6 +44,9 @@
;; Non alphanumeric characters can be found in URIs
("ftp://example.net/~foo!;#bar=baz&goo=bob" 3 url "ftp://example.net/~foo!;#bar=baz&goo=bob")
("bzr+ssh://user@example.net:5/a%20d,5" 34 url "bzr+ssh://user@example.net:5/a%20d,5")
+ ;; IPv6 brackets enclosed in [markup]
+ ("[http://[::1]:8000/foo]" 10 url "http://[::1]:8000/foo")
+ ("[http://[fe08::7:8%eth0]]" 10 url "http://[fe08::7:8%eth0]")
;; <url:...> markup
("Url: <url:foo://1.example.com>..." 8 url "foo://1.example.com")
("Url: <url:foo://2.example.com>..." 30 url "foo://2.example.com")