1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Add tests for cl-macs.el (Bug#27559)

* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-test-loop): Remove
duplicate.
(cl-loop-destructuring-with): Move to cl-macs-tests.el.
* test/lisp/emacs-lisp/cl-macs-tests.el: New file.
This commit is contained in:
Alexander Gramiak 2017-08-11 17:53:27 -06:00 committed by Noam Postavsky
parent 9d7973530f
commit ee9392a699
2 changed files with 502 additions and 8 deletions

View file

@ -1,4 +1,4 @@
;;; cl-lib.el --- tests for emacs-lisp/cl-lib.el -*- lexical-binding:t -*-
;;; cl-lib-tests.el --- tests for emacs-lisp/cl-lib.el -*- lexical-binding:t -*-
;; Copyright (C) 2013-2017 Free Software Foundation, Inc.
@ -195,9 +195,6 @@
(should (eql (cl-mismatch "Aa" "aA") 0))
(should (eql (cl-mismatch '(a b c) '(a b d)) 2)))
(ert-deftest cl-lib-test-loop ()
(should (eql (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
(ert-deftest cl-lib-keyword-names-versus-values ()
(should (equal
(funcall (cl-function (lambda (&key a b) (list a b)))
@ -480,9 +477,6 @@
(should (= 239 (cl-parse-integer "zzef" :radix 16 :start 2)))
(should (= -123 (cl-parse-integer " -123 "))))
(ert-deftest cl-loop-destructuring-with ()
(should (equal (cl-loop with (a b c) = '(1 2 3) return (+ a b c)) 6)))
(ert-deftest cl-flet-test ()
(should (equal (cl-flet ((f1 (x) x)) (let ((x #'f1)) (funcall x 5))) 5)))
@ -556,4 +550,4 @@
(should cl-old-struct-compat-mode)
(cl-old-struct-compat-mode (if saved 1 -1))))
;;; cl-lib.el ends here
;;; cl-lib-tests.el ends here