diff options
| author | Lars Ingebrigtsen | 2020-12-27 09:22:02 +0100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2020-12-27 09:22:02 +0100 |
| commit | eb98afaf354288c583ceb2fbdd647841d5c76b2d (patch) | |
| tree | 8b6b57a97af020820841cb3f86de350368d194ce /test/src | |
| parent | 80420faf4921ffe5e9d4c4f9595941acf3156e50 (diff) | |
| download | emacs-eb98afaf354288c583ceb2fbdd647841d5c76b2d.tar.gz emacs-eb98afaf354288c583ceb2fbdd647841d5c76b2d.zip | |
Fix up length_internal with degenerate length inputs
* src/fns.c (length_internal): Protect against edge conditions.
Diffstat (limited to 'test/src')
| -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 @@ | |||
| 1025 | (should (length= "abc" 3)) | 1025 | (should (length= "abc" 3)) |
| 1026 | (should-not (length= "abc" 4)) | 1026 | (should-not (length= "abc" 4)) |
| 1027 | 1027 | ||
| 1028 | (should-not (length< (list 1 2 3) -1)) | ||
| 1029 | (should-not (length< (list 1 2 3) 0)) | ||
| 1030 | (should-not (length< (list 1 2 3) -10)) | ||
| 1031 | |||
| 1032 | (should (length> (list 1 2 3) -1)) | ||
| 1033 | (should (length> (list 1 2 3) 0)) | ||
| 1034 | |||
| 1035 | (should-not (length= (list 1 2 3) -1)) | ||
| 1036 | (should-not (length= (list 1 2 3) 0)) | ||
| 1037 | (should-not (length= (list 1 2 3) 1)) | ||
| 1038 | |||
| 1028 | (should-error | 1039 | (should-error |
| 1029 | (let ((list (list 1))) | 1040 | (let ((list (list 1))) |
| 1030 | (setcdr list list) | 1041 | (setcdr list list) |