diff options
| author | Eli Zaretskii | 2015-11-24 21:13:46 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2015-11-24 21:13:46 +0200 |
| commit | 33ec2ff0f8b77f3c10af395d3e8979508cd78c0a (patch) | |
| tree | 86519a30bccfbda43cb1ed6b01ccdf58ae206fba /modules | |
| parent | 298b2b3f3520a6ad6dd9ae24fc8bd02a6ec9126e (diff) | |
| download | emacs-33ec2ff0f8b77f3c10af395d3e8979508cd78c0a.tar.gz emacs-33ec2ff0f8b77f3c10af395d3e8979508cd78c0a.zip | |
Add one more mod-test test
* modules/mod-test/test.el (mod-test-sum-test): Test the error
signaled when the function is invoked with a wrong number of
arguments.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/mod-test/test.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/mod-test/test.el b/modules/mod-test/test.el index 98ce46411bd..34090d9b062 100644 --- a/modules/mod-test/test.el +++ b/modules/mod-test/test.el | |||
| @@ -28,7 +28,17 @@ | |||
| 28 | ;; | 28 | ;; |
| 29 | 29 | ||
| 30 | (ert-deftest mod-test-sum-test () | 30 | (ert-deftest mod-test-sum-test () |
| 31 | (should (= (mod-test-sum 1 2) 3))) | 31 | (should (= (mod-test-sum 1 2) 3)) |
| 32 | (let ((descr (should-error (mod-test-sum 1 2 3)))) | ||
| 33 | (should (eq (car descr) 'wrong-number-of-arguments)) | ||
| 34 | (should (stringp (nth 1 descr))) | ||
| 35 | (should (eq 0 | ||
| 36 | (string-match | ||
| 37 | (if (eq system-type 'windows-nt) | ||
| 38 | "#<module function at \\(0x\\)?[0-9a-fA-F]+ from .*>" | ||
| 39 | "#<module function Fmod_test_sum from .*>") | ||
| 40 | (nth 1 descr)))) | ||
| 41 | (should (= (nth 2 descr) 3)))) | ||
| 32 | 42 | ||
| 33 | (ert-deftest mod-test-sum-docstring () | 43 | (ert-deftest mod-test-sum-docstring () |
| 34 | (should (string= (documentation 'mod-test-sum) "Return A + B"))) | 44 | (should (string= (documentation 'mod-test-sum) "Return A + B"))) |