diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2018-12-29 13:33:04 +0000 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2018-12-29 13:33:04 +0000 |
| commit | 2c6576f731282209492ca7c0217346deb9666785 (patch) | |
| tree | 6653ee2472244bfefe1edaf279566ca0f82dbceb | |
| parent | dcf0b2fc030675a6030e458a927d74025a954122 (diff) | |
Define our own function/variable for unit testing obsolescence data
This ensures the tests pass across different Emacs versions (which
might have more/less verbose information).
| -rw-r--r-- | test/helpful-unit-test.el | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/test/helpful-unit-test.el b/test/helpful-unit-test.el index b358486..bf5a2f1 100644 --- a/test/helpful-unit-test.el +++ b/test/helpful-unit-test.el @@ -13,6 +13,14 @@ (setq jka-compr-verbose nil)) +(defvar helpful-test-var nil) +(define-obsolete-variable-alias 'helpful-test-var-obsolete + 'helpful-test-var "23.1") + +(defun helpful-test-fun-obsolete () + (declare (obsolete helpful "1.2.3")) + nil) + (defun test-foo () "Docstring here." nil) @@ -459,18 +467,17 @@ associated a lambda with a keybinding." (ert-deftest helpful--obsolete-variable () "Test display of obsolete variable." - (let* ((var 'bookmark-read-annotation-text-func) + (let* ((var 'helpful-test-var-obsolete) (info (helpful--format-obsolete-info var nil))) (should - (equal info "This variable is obsolete since 23.1; -use bookmark-edit-annotation-text-func instead.")))) + (equal info "This variable is obsolete since 23.1; use helpful-test-var instead.")))) (ert-deftest helpful--obsolete-function () "Test display of obsolete function." - (let* ((fun 'ffap-submit-bug) + (let* ((fun 'helpful-test-fun-obsolete) (info (helpful--format-obsolete-info fun t))) (should - (equal info "This command is obsolete since 23.1; use report-emacs-bug instead.")))) + (equal info "This function is obsolete since 1.2.3; use helpful instead.")))) (ert-deftest helpful--keymap-keys--sparse () (let* ((parent-keymap (make-sparse-keymap)) |
