diff options
| author | Stefan Kangas | 2019-11-12 02:01:22 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2020-01-24 18:28:53 +0100 |
| commit | fcad41c14db874f139db45cbf9e90f7309687d20 (patch) | |
| tree | 1e6a16ee96fffbbb8544155f1127121dfb265ceb | |
| parent | a76e7d592f428e04b868724c9dfe57d35eb3744e (diff) | |
| download | emacs-fcad41c14db874f139db45cbf9e90f7309687d20.tar.gz emacs-fcad41c14db874f139db45cbf9e90f7309687d20.zip | |
Add tests for version comparison predicates
* test/lisp/subr-tests.el (subr-test-version-list-<)
(subr-test-version-list-=, subr-test-version-list-<=): New tests.
| -rw-r--r-- | test/lisp/subr-tests.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/lisp/subr-tests.el b/test/lisp/subr-tests.el index 059d52b1b6f..a583d57d2e8 100644 --- a/test/lisp/subr-tests.el +++ b/test/lisp/subr-tests.el | |||
| @@ -244,6 +244,27 @@ | |||
| 244 | (error-message-string (should-error (version-to-list "beta22_8alpha3"))) | 244 | (error-message-string (should-error (version-to-list "beta22_8alpha3"))) |
| 245 | "Invalid version syntax: `beta22_8alpha3' (must start with a number)")))) | 245 | "Invalid version syntax: `beta22_8alpha3' (must start with a number)")))) |
| 246 | 246 | ||
| 247 | (ert-deftest subr-test-version-list-< () | ||
| 248 | (should (version-list-< '(0) '(1))) | ||
| 249 | (should (version-list-< '(0 9) '(1 0))) | ||
| 250 | (should (version-list-< '(1 -1) '(1 0))) | ||
| 251 | (should (version-list-< '(1 -2) '(1 -1))) | ||
| 252 | (should (not (version-list-< '(1) '(0)))) | ||
| 253 | (should (not (version-list-< '(1 1) '(1 0)))) | ||
| 254 | (should (not (version-list-< '(1) '(1 0)))) | ||
| 255 | (should (not (version-list-< '(1 0) '(1 0 0))))) | ||
| 256 | |||
| 257 | (ert-deftest subr-test-version-list-= () | ||
| 258 | (should (version-list-= '(1) '(1))) | ||
| 259 | (should (version-list-= '(1 0) '(1))) | ||
| 260 | (should (not (version-list-= '(0) '(1))))) | ||
| 261 | |||
| 262 | (ert-deftest subr-test-version-list-<= () | ||
| 263 | (should (version-list-<= '(0) '(1))) | ||
| 264 | (should (version-list-<= '(1) '(1))) | ||
| 265 | (should (version-list-<= '(1 0) '(1))) | ||
| 266 | (should (not (version-list-<= '(1) '(0))))) | ||
| 267 | |||
| 247 | (defun subr-test--backtrace-frames-with-backtrace-frame (base) | 268 | (defun subr-test--backtrace-frames-with-backtrace-frame (base) |
| 248 | "Reference implementation of `backtrace-frames'." | 269 | "Reference implementation of `backtrace-frames'." |
| 249 | (let ((idx 0) | 270 | (let ((idx 0) |