diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-27 09:22:02 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2020-12-27 09:22:02 +0100 |
commit | eb98afaf354288c583ceb2fbdd647841d5c76b2d (patch) | |
tree | 8b6b57a97af020820841cb3f86de350368d194ce /test/src/fns-tests.el | |
parent | 80420faf4921ffe5e9d4c4f9595941acf3156e50 (diff) | |
download | emacs-eb98afaf354288c583ceb2fbdd647841d5c76b2d.tar.gz |
Fix up length_internal with degenerate length inputs
* src/fns.c (length_internal): Protect against edge conditions.
Diffstat (limited to 'test/src/fns-tests.el')
-rw-r--r-- | test/src/fns-tests.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 3486c745bf3..e66dad44a1a 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -1025,6 +1025,17 @@ (should (length= "abc" 3)) (should-not (length= "abc" 4)) + (should-not (length< (list 1 2 3) -1)) + (should-not (length< (list 1 2 3) 0)) + (should-not (length< (list 1 2 3) -10)) + + (should (length> (list 1 2 3) -1)) + (should (length> (list 1 2 3) 0)) + + (should-not (length= (list 1 2 3) -1)) + (should-not (length= (list 1 2 3) 0)) + (should-not (length= (list 1 2 3) 1)) + (should-error (let ((list (list 1))) (setcdr list list) |