diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2019-03-16 16:39:24 +0000 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2019-03-16 16:39:24 +0000 |
| commit | d5b0eb78731df41a9f20ebf4f3c2d15e8a3d22d8 (patch) | |
| tree | 5e968a409be9eadb0e78f70906abcbefa43b470e /test/helpful-unit-test.el | |
| parent | 9f1d08c3d4292f778b14838da35701714ea0e231 (diff) | |
Don't interpret "`foo'" as a symbol reference
This requires `foo' to be handled as part of the loop in
`helpful--format-command-keys' rather than a separate function.
Helps with #197
Diffstat (limited to 'test/helpful-unit-test.el')
| -rw-r--r-- | test/helpful-unit-test.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el index 6d1e42d..3010708 100644 --- a/test/helpful-unit-test.el +++ b/test/helpful-unit-test.el @@ -56,7 +56,11 @@ ;; We should handle stray backquotes. (let* ((formatted-docstring (helpful--format-docstring "`foo `message'"))) (should - (equal formatted-docstring "`foo message")))) + (equal formatted-docstring "`foo message"))) + ;; Handle a missing closing '. + (let* ((formatted-docstring (helpful--format-docstring "`foo"))) + (should + (equal formatted-docstring "`foo")))) (ert-deftest helpful--docstring-unescape () "Discard \\=\\= in docstrings." @@ -266,13 +270,15 @@ symbol (not a form)." (should (eq (get-text-property 0 'face formatted) - 'button))) - ;; Propertize mode maps. - (-let [formatted (helpful--format-docstring "`\\{python-mode-map}'")] + 'button)))) + +(ert-deftest helpful--format-docstring-mode-maps () + "Ensure we propertize references to keymaps." + (-let [formatted (helpful--format-docstring "\\{python-mode-map}")] (should (s-contains-p "run-python" formatted))) ;; Handle non-existent mode maps gracefully. - (-let [formatted (helpful--format-docstring "`\\{no-such-mode-map}'")] + (-let [formatted (helpful--format-docstring "\\{no-such-mode-map}")] (should (s-contains-p "not currently defined" formatted)))) |
