aboutsummaryrefslogtreecommitdiff
path: root/test/helpful-unit-test.el
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpful-unit-test.el')
-rw-r--r--test/helpful-unit-test.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el
index 541639c..008a052 100644
--- a/test/helpful-unit-test.el
+++ b/test/helpful-unit-test.el
@@ -141,6 +141,18 @@ symbol (not a form)."
;; `rename-buffer' is primitive, but it's advised by uniquify.
(should (helpful--primitive-p 'rename-buffer t)))
+(ert-deftest helpful--without-advice ()
+ "Ensure we remove advice to get the underlying function."
+ ;; Removing the advice on an unadvised function should give us the
+ ;; same function.
+ (should
+ (eq (helpful--without-advice #'test-foo)
+ (indirect-function #'test-foo)))
+ ;; Removing the advice should give us an unadvised function.
+ (should
+ (not (helpful--advised-p
+ (helpful--without-advice #'test-foo-advised)))))
+
(ert-deftest helpful-callable ()
;; Functions. Also a regression test for #170.
(helpful-callable 'face-attribute)