From d210e1fc2cf1c2d095471cefa700a0d1703f4ab6 Mon Sep 17 00:00:00 2001 From: deviantfero Date: Tue, 8 Oct 2019 14:44:30 -0600 Subject: main el file: add dots and caps to evil-surround-tag-name-re tests: add tests for caps and dots support in tag names --- evil-surround.el | 2 +- test/evil-surround-test.el | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/evil-surround.el b/evil-surround.el index 6eb3a11..6a92d08 100644 --- a/evil-surround.el +++ b/evil-surround.el @@ -134,7 +134,7 @@ Each item is of the form (OPERATOR . OPERATION)." (cons (format "%s(" (or fname "")) ")"))) -(defconst evil-surround-tag-name-re "\\([0-9a-z-]+\\)" +(defconst evil-surround-tag-name-re "\\([0-9a-zA-Z\.-]+\\)" "Regexp matching an XML tag name.") (defun evil-surround-tag-p (string) diff --git a/test/evil-surround-test.el b/test/evil-surround-test.el index 1beaae4..0ab98de 100644 --- a/test/evil-surround-test.el +++ b/test/evil-surround-test.el @@ -73,6 +73,22 @@ "Hello world!" ("ysiw") "Hello world!")) + (ert-info ("tests for dots and caps support in tags") + (evil-test-buffer + :visual-start nil + :visual-end nil + "\"Hello world!\"" + (turn-on-evil-surround-mode) + ("cs\"'") + "'Hello world!'" + ("cs'") + "Hello world!" + ("dst") + "Hello world!" + ("ysiw") + "Hello world!" + ("cst") + "Hello world!")) (ert-info ("more examples from readme: function surrounding with dot repeat") (evil-test-buffer :visual-start nil -- cgit v1.0