commit e668bdf406be70bba8f6f99e8f5e77d23f601b84
parent 30f93e387a66e4f39455986728ecd60c176e2279
Author: Wilfred Hughes <me@wilfred.me.uk>
Date: Sun, 27 Aug 2017 11:13:36 +0100
Fix failing docstring tests
Diffstat:
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/helpful.el b/helpful.el
@@ -619,7 +619,8 @@ For example, \"(some-func FOO &optional BAR)\"."
"Get the docstring for SYM."
(let (docstring)
(if callable-p
- (-when-let (docstring (documentation sym))
+ (progn
+ (setq docstring (documentation sym))
(-when-let (docstring-with-usage (help-split-fundoc docstring sym))
(setq docstring (cdr docstring-with-usage))
(when docstring
diff --git a/test/unit-test.el b/test/unit-test.el
@@ -21,14 +21,14 @@
"Basic docstring fetching."
(should
(equal
- (helpful--docstring #'test-foo)
+ (helpful--docstring #'test-foo t)
"Docstring here.")))
(ert-deftest helpful--docstring-advice ()
"Get the docstring on advised functions."
(should
(equal
- (helpful--docstring #'test-foo-advised)
+ (helpful--docstring #'test-foo-advised t)
"Docstring here too.")))
(defun test-foo-no-docstring ()
@@ -36,7 +36,7 @@
(ert-deftest helpful--no-docstring ()
"We should not crash on a function without a docstring."
- (should (null (helpful--docstring #'test-foo-no-docstring))))
+ (should (null (helpful--docstring #'test-foo-no-docstring t))))
(defun test-foo-usage-docstring ()
"\n\n(fn &rest ARGS)"
@@ -44,7 +44,7 @@
(ert-deftest helpful--usage-docstring ()
"If a function docstring only has usage, do not return it."
- (should (null (helpful--docstring #'test-foo-usage-docstring))))
+ (should (null (helpful--docstring #'test-foo-usage-docstring t))))
(defun test-foo-no-properties ()
nil)