diff options
| -rw-r--r-- | test/src/fns-tests.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 2d641cc3111..3dc2e7b3ec8 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el | |||
| @@ -23,6 +23,29 @@ | |||
| 23 | 23 | ||
| 24 | (require 'cl-lib) | 24 | (require 'cl-lib) |
| 25 | 25 | ||
| 26 | (ert-deftest fns-tests-identity () | ||
| 27 | (let ((num 12345)) (should (eq (identity num) num))) | ||
| 28 | (let ((str "foo")) (should (eq (identity str) str))) | ||
| 29 | (let ((lst '(11))) (should (eq (identity lst) lst)))) | ||
| 30 | |||
| 31 | (ert-deftest fns-tests-random () | ||
| 32 | (should (integerp (random))) | ||
| 33 | (should (>= (random 10) 0)) | ||
| 34 | (should (< (random 10) 10))) | ||
| 35 | |||
| 36 | (ert-deftest fns-tests-length () | ||
| 37 | (should (= (length nil) 0)) | ||
| 38 | (should (= (length '(1 2 3)) 3)) | ||
| 39 | (should (= (length '[1 2 3]) 3)) | ||
| 40 | (should (= (length "foo") 3)) | ||
| 41 | (should-error (length t))) | ||
| 42 | |||
| 43 | (ert-deftest fns-tests-safe-length () | ||
| 44 | (should (= (safe-length '(1 2 3)) 3))) | ||
| 45 | |||
| 46 | (ert-deftest fns-tests-string-bytes () | ||
| 47 | (should (= (string-bytes "abc") 3))) | ||
| 48 | |||
| 26 | ;; Test that equality predicates work correctly on NaNs when combined | 49 | ;; Test that equality predicates work correctly on NaNs when combined |
| 27 | ;; with hash tables based on those predicates. This was not the case | 50 | ;; with hash tables based on those predicates. This was not the case |
| 28 | ;; for eql in Emacs 26. | 51 | ;; for eql in Emacs 26. |