diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2018-01-07 00:04:26 +0000 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2018-01-07 00:10:50 +0000 |
| commit | 8e5390f0e8983816b938607c9b3a42fd7b868a00 (patch) | |
| tree | 85b4a8a74b6fb7b83e30e8d20253f6706848c884 /test/unit-test.el | |
| parent | 53dd618dc2d5fbd6b6edf72fb29210c8d129728b (diff) | |
Stricter regexps for highlighting `foo' in docstrings
Previously, the regexp was greedy, so we would erroneously highlight:
`foo `bar'
as a single symbol. Fixes #87.
Diffstat (limited to 'test/unit-test.el')
| -rw-r--r-- | test/unit-test.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit-test.el b/test/unit-test.el index db75500..2579316 100644 --- a/test/unit-test.el +++ b/test/unit-test.el @@ -27,6 +27,18 @@ (helpful--docstring #'test-foo t) "Docstring here."))) +(ert-deftest helpful--docstring-symbol () + "Correctly handle quotes around symbols." + ;; We should replace quoted symbols with links, so the punctuation + ;; should not be in the output. + (let* ((formatted-docstring (helpful--format-docstring "`message'"))) + (should + (equal formatted-docstring "message"))) + ;; We should handle stray backquotes. + (let* ((formatted-docstring (helpful--format-docstring "`foo `message'"))) + (should + (equal formatted-docstring "`foo message")))) + (ert-deftest helpful--docstring-unescape () "Discard \\=\\= in docstrings." (let* ((docstring (helpful--docstring #'apply t)) |
