]> code.delx.au - gnu-emacs/blobdiff - test/automated/subr-tests.el
Fix infloop in 'number-sequence'
[gnu-emacs] / test / automated / subr-tests.el
index 3fcb7d346a3999bb90f8f61a201da2cdd0a73f1d..ce212903c9d3cb41deb4c52d97d0305e4a49a0ec 100644 (file)
@@ -1,6 +1,6 @@
 ;;; subr-tests.el --- Tests for subr.el
 
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2016 Free Software Foundation, Inc.
 
 ;; Author: Oleh Krehel <ohwoeowho@gmail.com>,
 ;;         Nicolas Petton <nicolas@petton.fr>
                      (quote
                       (0 font-lock-keyword-face))))))))
 
+(ert-deftest number-sequence-test ()
+  (should (= (length
+              (number-sequence (1- most-positive-fixnum) most-positive-fixnum))
+             2))
+  (should (= (length
+              (number-sequence
+               (1+ most-negative-fixnum) most-negative-fixnum -1))
+             2)))
+
 (ert-deftest string-comparison-test ()
   (should (string-lessp "abc" "acb"))
   (should (string-lessp "aBc" "abc"))