diff options
| author | Glenn Morris | 2013-07-11 09:13:38 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-07-11 09:13:38 -0700 |
| commit | a19b3c2d975c605c3ed76f1c178cdec7c3c7bdcf (patch) | |
| tree | cd87d97c915194a3e615fac8445c90b7419876b0 | |
| parent | 17bd3d0493fa7d0ecfa60a646141abebfc8290eb (diff) | |
| download | emacs-a19b3c2d975c605c3ed76f1c178cdec7c3c7bdcf.tar.gz emacs-a19b3c2d975c605c3ed76f1c178cdec7c3c7bdcf.zip | |
Stop reimplementing a bunch of cl- functions in ert
* lisp/emacs-lisp/ert.el: Require cl-lib at runtime too.
(ert--cl-do-remf, ert--remprop, ert--remove-if-not)
(ert--intersection, ert--set-difference, ert--set-difference-eq)
(ert--union, ert--gensym-counter, ert--gensym-counter)
(ert--coerce-to-vector, ert--remove*, ert--string-position)
(ert--mismatch, ert--subseq): Remove reimplementations of cl funcs.
(ert-make-test-unbound, ert--expand-should-1)
(ert--expand-should, ert--should-error-handle-error)
(should-error, ert--explain-equal-rec)
(ert--plist-difference-explanation, ert-select-tests)
(ert--make-stats, ert--remove-from-list, ert--string-first-line):
Use cl-lib functions rather than reimplementations.
* test/automated/ert-tests.el: Require cl-lib at runtime too.
(ert-test-special-operator-p): Use cl-gensym rather than ert-- version.
(ert-test-remprop, ert-test-remove-if-not, ert-test-remove*)
(ert-test-set-functions, ert-test-gensym)
(ert-test-coerce-to-vector, ert-test-string-position)
(ert-test-mismatch): Remove tests.
* test/automated/cl-lib.el: New, split from ert-tests.el.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/emacs-lisp/ert.el | 173 | ||||
| -rw-r--r-- | test/ChangeLog | 8 | ||||
| -rw-r--r-- | test/automated/cl-lib.el | 198 | ||||
| -rw-r--r-- | test/automated/ert-tests.el | 171 |
5 files changed, 249 insertions, 316 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29f053c5ae1..7f5fd1efb23 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2013-07-11 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/ert.el: Require cl-lib at runtime too. | ||
| 4 | (ert--cl-do-remf, ert--remprop, ert--remove-if-not) | ||
| 5 | (ert--intersection, ert--set-difference, ert--set-difference-eq) | ||
| 6 | (ert--union, ert--gensym-counter, ert--gensym-counter) | ||
| 7 | (ert--coerce-to-vector, ert--remove*, ert--string-position) | ||
| 8 | (ert--mismatch, ert--subseq): Remove reimplementations of cl funcs. | ||
| 9 | (ert-make-test-unbound, ert--expand-should-1) | ||
| 10 | (ert--expand-should, ert--should-error-handle-error) | ||
| 11 | (should-error, ert--explain-equal-rec) | ||
| 12 | (ert--plist-difference-explanation, ert-select-tests) | ||
| 13 | (ert--make-stats, ert--remove-from-list, ert--string-first-line): | ||
| 14 | Use cl-lib functions rather than reimplementations. | ||
| 15 | |||
| 1 | 2013-07-11 Michael Albinus <michael.albinus@gmx.de> | 16 | 2013-07-11 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 17 | ||
| 3 | * net/tramp.el (tramp-methods): Extend docstring. | 18 | * net/tramp.el (tramp-methods): Extend docstring. |
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 656cb0a6a14..1f5edefea08 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | 54 | ||
| 55 | ;;; Code: | 55 | ;;; Code: |
| 56 | 56 | ||
| 57 | (eval-when-compile (require 'cl-lib)) | 57 | (require 'cl-lib) |
| 58 | (require 'button) | 58 | (require 'button) |
| 59 | (require 'debug) | 59 | (require 'debug) |
| 60 | (require 'easymenu) | 60 | (require 'easymenu) |
| @@ -87,127 +87,6 @@ | |||
| 87 | 87 | ||
| 88 | ;;; Copies/reimplementations of cl functions. | 88 | ;;; Copies/reimplementations of cl functions. |
| 89 | 89 | ||
| 90 | (defun ert--cl-do-remf (plist tag) | ||
| 91 | "Copy of `cl-do-remf'. Modify PLIST by removing TAG." | ||
| 92 | (let ((p (cdr plist))) | ||
| 93 | (while (and (cdr p) (not (eq (car (cdr p)) tag))) (setq p (cdr (cdr p)))) | ||
| 94 | (and (cdr p) (progn (setcdr p (cdr (cdr (cdr p)))) t)))) | ||
| 95 | |||
| 96 | (defun ert--remprop (sym tag) | ||
| 97 | "Copy of `cl-remprop'. Modify SYM's plist by removing TAG." | ||
| 98 | (let ((plist (symbol-plist sym))) | ||
| 99 | (if (and plist (eq tag (car plist))) | ||
| 100 | (progn (setplist sym (cdr (cdr plist))) t) | ||
| 101 | (ert--cl-do-remf plist tag)))) | ||
| 102 | |||
| 103 | (defun ert--remove-if-not (ert-pred ert-list) | ||
| 104 | "A reimplementation of `remove-if-not'. | ||
| 105 | |||
| 106 | ERT-PRED is a predicate, ERT-LIST is the input list." | ||
| 107 | (cl-loop for ert-x in ert-list | ||
| 108 | if (funcall ert-pred ert-x) | ||
| 109 | collect ert-x)) | ||
| 110 | |||
| 111 | (defun ert--intersection (a b) | ||
| 112 | "A reimplementation of `intersection'. Intersect the sets A and B. | ||
| 113 | |||
| 114 | Elements are compared using `eql'." | ||
| 115 | (cl-loop for x in a | ||
| 116 | if (memql x b) | ||
| 117 | collect x)) | ||
| 118 | |||
| 119 | (defun ert--set-difference (a b) | ||
| 120 | "A reimplementation of `set-difference'. Subtract the set B from the set A. | ||
| 121 | |||
| 122 | Elements are compared using `eql'." | ||
| 123 | (cl-loop for x in a | ||
| 124 | unless (memql x b) | ||
| 125 | collect x)) | ||
| 126 | |||
| 127 | (defun ert--set-difference-eq (a b) | ||
| 128 | "A reimplementation of `set-difference'. Subtract the set B from the set A. | ||
| 129 | |||
| 130 | Elements are compared using `eq'." | ||
| 131 | (cl-loop for x in a | ||
| 132 | unless (memq x b) | ||
| 133 | collect x)) | ||
| 134 | |||
| 135 | (defun ert--union (a b) | ||
| 136 | "A reimplementation of `union'. Compute the union of the sets A and B. | ||
| 137 | |||
| 138 | Elements are compared using `eql'." | ||
| 139 | (append a (ert--set-difference b a))) | ||
| 140 | |||
| 141 | (eval-and-compile | ||
| 142 | (defvar ert--gensym-counter 0)) | ||
| 143 | |||
| 144 | (eval-and-compile | ||
| 145 | (defun ert--gensym (&optional prefix) | ||
| 146 | "Only allows string PREFIX, not compatible with CL." | ||
| 147 | (unless prefix (setq prefix "G")) | ||
| 148 | (make-symbol (format "%s%s" | ||
| 149 | prefix | ||
| 150 | (prog1 ert--gensym-counter | ||
| 151 | (cl-incf ert--gensym-counter)))))) | ||
| 152 | |||
| 153 | (defun ert--coerce-to-vector (x) | ||
| 154 | "Coerce X to a vector." | ||
| 155 | (when (char-table-p x) (error "Not supported")) | ||
| 156 | (if (vectorp x) | ||
| 157 | x | ||
| 158 | (vconcat x))) | ||
| 159 | |||
| 160 | (cl-defun ert--remove* (x list &key key test) | ||
| 161 | "Does not support all the keywords of remove*." | ||
| 162 | (unless key (setq key #'identity)) | ||
| 163 | (unless test (setq test #'eql)) | ||
| 164 | (cl-loop for y in list | ||
| 165 | unless (funcall test x (funcall key y)) | ||
| 166 | collect y)) | ||
| 167 | |||
| 168 | (defun ert--string-position (c s) | ||
| 169 | "Return the position of the first occurrence of C in S, or nil if none." | ||
| 170 | (cl-loop for i from 0 | ||
| 171 | for x across s | ||
| 172 | when (eql x c) return i)) | ||
| 173 | |||
| 174 | (defun ert--mismatch (a b) | ||
| 175 | "Return index of first element that differs between A and B. | ||
| 176 | |||
| 177 | Like `mismatch'. Uses `equal' for comparison." | ||
| 178 | (cond ((or (listp a) (listp b)) | ||
| 179 | (ert--mismatch (ert--coerce-to-vector a) | ||
| 180 | (ert--coerce-to-vector b))) | ||
| 181 | ((> (length a) (length b)) | ||
| 182 | (ert--mismatch b a)) | ||
| 183 | (t | ||
| 184 | (let ((la (length a)) | ||
| 185 | (lb (length b))) | ||
| 186 | (cl-assert (arrayp a) t) | ||
| 187 | (cl-assert (arrayp b) t) | ||
| 188 | (cl-assert (<= la lb) t) | ||
| 189 | (cl-loop for i below la | ||
| 190 | when (not (equal (aref a i) (aref b i))) return i | ||
| 191 | finally (cl-return (if (/= la lb) | ||
| 192 | la | ||
| 193 | (cl-assert (equal a b) t) | ||
| 194 | nil))))))) | ||
| 195 | |||
| 196 | (defun ert--subseq (seq start &optional end) | ||
| 197 | "Return a subsequence of SEQ from START to END." | ||
| 198 | (when (char-table-p seq) (error "Not supported")) | ||
| 199 | (let ((vector (substring (ert--coerce-to-vector seq) start end))) | ||
| 200 | (cl-etypecase seq | ||
| 201 | (vector vector) | ||
| 202 | (string (concat vector)) | ||
| 203 | (list (append vector nil)) | ||
| 204 | (bool-vector (cl-loop with result | ||
| 205 | = (make-bool-vector (length vector) nil) | ||
| 206 | for i below (length vector) do | ||
| 207 | (setf (aref result i) (aref vector i)) | ||
| 208 | finally (cl-return result))) | ||
| 209 | (char-table (cl-assert nil))))) | ||
| 210 | |||
| 211 | (defun ert-equal-including-properties (a b) | 90 | (defun ert-equal-including-properties (a b) |
| 212 | "Return t if A and B have similar structure and contents. | 91 | "Return t if A and B have similar structure and contents. |
| 213 | 92 | ||
| @@ -258,7 +137,7 @@ Emacs bug 6581 at URL `http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6581'." | |||
| 258 | 137 | ||
| 259 | (defun ert-make-test-unbound (symbol) | 138 | (defun ert-make-test-unbound (symbol) |
| 260 | "Make SYMBOL name no test. Return SYMBOL." | 139 | "Make SYMBOL name no test. Return SYMBOL." |
| 261 | (ert--remprop symbol 'ert--test) | 140 | (cl-remprop symbol 'ert--test) |
| 262 | symbol) | 141 | symbol) |
| 263 | 142 | ||
| 264 | (defun ert--parse-keys-and-body (keys-and-body) | 143 | (defun ert--parse-keys-and-body (keys-and-body) |
| @@ -396,8 +275,8 @@ DATA is displayed to the user and should state the reason of the failure." | |||
| 396 | cl-macro-environment))))) | 275 | cl-macro-environment))))) |
| 397 | (cond | 276 | (cond |
| 398 | ((or (atom form) (ert--special-operator-p (car form))) | 277 | ((or (atom form) (ert--special-operator-p (car form))) |
| 399 | (let ((value (ert--gensym "value-"))) | 278 | (let ((value (cl-gensym "value-"))) |
| 400 | `(let ((,value (ert--gensym "ert-form-evaluation-aborted-"))) | 279 | `(let ((,value (cl-gensym "ert-form-evaluation-aborted-"))) |
| 401 | ,(funcall inner-expander | 280 | ,(funcall inner-expander |
| 402 | `(setq ,value ,form) | 281 | `(setq ,value ,form) |
| 403 | `(list ',whole :form ',form :value ,value) | 282 | `(list ',whole :form ',form :value ,value) |
| @@ -410,10 +289,10 @@ DATA is displayed to the user and should state the reason of the failure." | |||
| 410 | (and (consp fn-name) | 289 | (and (consp fn-name) |
| 411 | (eql (car fn-name) 'lambda) | 290 | (eql (car fn-name) 'lambda) |
| 412 | (listp (cdr fn-name))))) | 291 | (listp (cdr fn-name))))) |
| 413 | (let ((fn (ert--gensym "fn-")) | 292 | (let ((fn (cl-gensym "fn-")) |
| 414 | (args (ert--gensym "args-")) | 293 | (args (cl-gensym "args-")) |
| 415 | (value (ert--gensym "value-")) | 294 | (value (cl-gensym "value-")) |
| 416 | (default-value (ert--gensym "ert-form-evaluation-aborted-"))) | 295 | (default-value (cl-gensym "ert-form-evaluation-aborted-"))) |
| 417 | `(let ((,fn (function ,fn-name)) | 296 | `(let ((,fn (function ,fn-name)) |
| 418 | (,args (list ,@arg-forms))) | 297 | (,args (list ,@arg-forms))) |
| 419 | (let ((,value ',default-value)) | 298 | (let ((,value ',default-value)) |
| @@ -450,7 +329,7 @@ FORM-DESCRIPTION-FORM before it has called INNER-FORM." | |||
| 450 | (ert--expand-should-1 | 329 | (ert--expand-should-1 |
| 451 | whole form | 330 | whole form |
| 452 | (lambda (inner-form form-description-form value-var) | 331 | (lambda (inner-form form-description-form value-var) |
| 453 | (let ((form-description (ert--gensym "form-description-"))) | 332 | (let ((form-description (cl-gensym "form-description-"))) |
| 454 | `(let (,form-description) | 333 | `(let (,form-description) |
| 455 | ,(funcall inner-expander | 334 | ,(funcall inner-expander |
| 456 | `(unwind-protect | 335 | `(unwind-protect |
| @@ -491,7 +370,7 @@ and aborts the current test as failed if it doesn't." | |||
| 491 | (list type) | 370 | (list type) |
| 492 | (symbol (list type))))) | 371 | (symbol (list type))))) |
| 493 | (cl-assert signaled-conditions) | 372 | (cl-assert signaled-conditions) |
| 494 | (unless (ert--intersection signaled-conditions handled-conditions) | 373 | (unless (cl-intersection signaled-conditions handled-conditions) |
| 495 | (ert-fail (append | 374 | (ert-fail (append |
| 496 | (funcall form-description-fn) | 375 | (funcall form-description-fn) |
| 497 | (list | 376 | (list |
| @@ -528,8 +407,8 @@ failed." | |||
| 528 | `(should-error ,form ,@keys) | 407 | `(should-error ,form ,@keys) |
| 529 | form | 408 | form |
| 530 | (lambda (inner-form form-description-form value-var) | 409 | (lambda (inner-form form-description-form value-var) |
| 531 | (let ((errorp (ert--gensym "errorp")) | 410 | (let ((errorp (cl-gensym "errorp")) |
| 532 | (form-description-fn (ert--gensym "form-description-fn-"))) | 411 | (form-description-fn (cl-gensym "form-description-fn-"))) |
| 533 | `(let ((,errorp nil) | 412 | `(let ((,errorp nil) |
| 534 | (,form-description-fn (lambda () ,form-description-form))) | 413 | (,form-description-fn (lambda () ,form-description-form))) |
| 535 | (condition-case -condition- | 414 | (condition-case -condition- |
| @@ -591,7 +470,7 @@ Returns nil if they are." | |||
| 591 | `(proper-lists-of-different-length ,(length a) ,(length b) | 470 | `(proper-lists-of-different-length ,(length a) ,(length b) |
| 592 | ,a ,b | 471 | ,a ,b |
| 593 | first-mismatch-at | 472 | first-mismatch-at |
| 594 | ,(ert--mismatch a b)) | 473 | ,(cl-mismatch a b :test 'equal)) |
| 595 | (cl-loop for i from 0 | 474 | (cl-loop for i from 0 |
| 596 | for ai in a | 475 | for ai in a |
| 597 | for bi in b | 476 | for bi in b |
| @@ -611,7 +490,7 @@ Returns nil if they are." | |||
| 611 | ,a ,b | 490 | ,a ,b |
| 612 | ,@(unless (char-table-p a) | 491 | ,@(unless (char-table-p a) |
| 613 | `(first-mismatch-at | 492 | `(first-mismatch-at |
| 614 | ,(ert--mismatch a b)))) | 493 | ,(cl-mismatch a b :test 'equal)))) |
| 615 | (cl-loop for i from 0 | 494 | (cl-loop for i from 0 |
| 616 | for ai across a | 495 | for ai across a |
| 617 | for bi across b | 496 | for bi across b |
| @@ -656,8 +535,8 @@ key/value pairs in each list does not matter." | |||
| 656 | ;; work, so let's punt on it for now. | 535 | ;; work, so let's punt on it for now. |
| 657 | (let* ((keys-a (ert--significant-plist-keys a)) | 536 | (let* ((keys-a (ert--significant-plist-keys a)) |
| 658 | (keys-b (ert--significant-plist-keys b)) | 537 | (keys-b (ert--significant-plist-keys b)) |
| 659 | (keys-in-a-not-in-b (ert--set-difference-eq keys-a keys-b)) | 538 | (keys-in-a-not-in-b (cl-set-difference keys-a keys-b :test 'eq)) |
| 660 | (keys-in-b-not-in-a (ert--set-difference-eq keys-b keys-a))) | 539 | (keys-in-b-not-in-a (cl-set-difference keys-b keys-a :test 'eq))) |
| 661 | (cl-flet ((explain-with-key (key) | 540 | (cl-flet ((explain-with-key (key) |
| 662 | (let ((value-a (plist-get a key)) | 541 | (let ((value-a (plist-get a key)) |
| 663 | (value-b (plist-get b key))) | 542 | (value-b (plist-get b key))) |
| @@ -1090,7 +969,7 @@ contained in UNIVERSE." | |||
| 1090 | (cl-etypecase universe | 969 | (cl-etypecase universe |
| 1091 | ((member t) (mapcar #'ert-get-test | 970 | ((member t) (mapcar #'ert-get-test |
| 1092 | (apropos-internal selector #'ert-test-boundp))) | 971 | (apropos-internal selector #'ert-test-boundp))) |
| 1093 | (list (ert--remove-if-not (lambda (test) | 972 | (list (cl-remove-if-not (lambda (test) |
| 1094 | (and (ert-test-name test) | 973 | (and (ert-test-name test) |
| 1095 | (string-match selector | 974 | (string-match selector |
| 1096 | (ert-test-name test)))) | 975 | (ert-test-name test)))) |
| @@ -1123,13 +1002,13 @@ contained in UNIVERSE." | |||
| 1123 | (not | 1002 | (not |
| 1124 | (cl-assert (eql (length operands) 1)) | 1003 | (cl-assert (eql (length operands) 1)) |
| 1125 | (let ((all-tests (ert-select-tests 't universe))) | 1004 | (let ((all-tests (ert-select-tests 't universe))) |
| 1126 | (ert--set-difference all-tests | 1005 | (cl-set-difference all-tests |
| 1127 | (ert-select-tests (car operands) | 1006 | (ert-select-tests (car operands) |
| 1128 | all-tests)))) | 1007 | all-tests)))) |
| 1129 | (or | 1008 | (or |
| 1130 | (cl-case (length operands) | 1009 | (cl-case (length operands) |
| 1131 | (0 (ert-select-tests 'nil universe)) | 1010 | (0 (ert-select-tests 'nil universe)) |
| 1132 | (t (ert--union (ert-select-tests (car operands) universe) | 1011 | (t (cl-union (ert-select-tests (car operands) universe) |
| 1133 | (ert-select-tests `(or ,@(cdr operands)) | 1012 | (ert-select-tests `(or ,@(cdr operands)) |
| 1134 | universe))))) | 1013 | universe))))) |
| 1135 | (tag | 1014 | (tag |
| @@ -1141,7 +1020,7 @@ contained in UNIVERSE." | |||
| 1141 | universe))) | 1020 | universe))) |
| 1142 | (satisfies | 1021 | (satisfies |
| 1143 | (cl-assert (eql (length operands) 1)) | 1022 | (cl-assert (eql (length operands) 1)) |
| 1144 | (ert--remove-if-not (car operands) | 1023 | (cl-remove-if-not (car operands) |
| 1145 | (ert-select-tests 't universe)))))))) | 1024 | (ert-select-tests 't universe)))))))) |
| 1146 | 1025 | ||
| 1147 | (defun ert--insert-human-readable-selector (selector) | 1026 | (defun ert--insert-human-readable-selector (selector) |
| @@ -1285,7 +1164,7 @@ Also changes the counters in STATS to match." | |||
| 1285 | "Create a new `ert--stats' object for running TESTS. | 1164 | "Create a new `ert--stats' object for running TESTS. |
| 1286 | 1165 | ||
| 1287 | SELECTOR is the selector that was used to select TESTS." | 1166 | SELECTOR is the selector that was used to select TESTS." |
| 1288 | (setq tests (ert--coerce-to-vector tests)) | 1167 | (setq tests (cl-coerce tests 'vector)) |
| 1289 | (let ((map (make-hash-table :size (length tests)))) | 1168 | (let ((map (make-hash-table :size (length tests)))) |
| 1290 | (cl-loop for i from 0 | 1169 | (cl-loop for i from 0 |
| 1291 | for test across tests | 1170 | for test across tests |
| @@ -1548,10 +1427,10 @@ This can be used as an inverse of `add-to-list'." | |||
| 1548 | (unless key (setq key #'identity)) | 1427 | (unless key (setq key #'identity)) |
| 1549 | (unless test (setq test #'equal)) | 1428 | (unless test (setq test #'equal)) |
| 1550 | (setf (symbol-value list-var) | 1429 | (setf (symbol-value list-var) |
| 1551 | (ert--remove* element | 1430 | (cl-remove element |
| 1552 | (symbol-value list-var) | 1431 | (symbol-value list-var) |
| 1553 | :key key | 1432 | :key key |
| 1554 | :test test))) | 1433 | :test test))) |
| 1555 | 1434 | ||
| 1556 | 1435 | ||
| 1557 | ;;; Some basic interactive functions. | 1436 | ;;; Some basic interactive functions. |
| @@ -1810,7 +1689,7 @@ BEGIN and END specify a region in the current buffer." | |||
| 1810 | "Return the first line of S, or S if it contains no newlines. | 1689 | "Return the first line of S, or S if it contains no newlines. |
| 1811 | 1690 | ||
| 1812 | The return value does not include the line terminator." | 1691 | The return value does not include the line terminator." |
| 1813 | (substring s 0 (ert--string-position ?\n s))) | 1692 | (substring s 0 (cl-position ?\n s))) |
| 1814 | 1693 | ||
| 1815 | (defun ert-face-for-test-result (expectedp) | 1694 | (defun ert-face-for-test-result (expectedp) |
| 1816 | "Return a face that shows whether a test result was expected or unexpected. | 1695 | "Return a face that shows whether a test result was expected or unexpected. |
diff --git a/test/ChangeLog b/test/ChangeLog index 29aa736e8ab..1282ff07246 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,5 +1,13 @@ | |||
| 1 | 2013-07-11 Glenn Morris <rgm@gnu.org> | 1 | 2013-07-11 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * automated/ert-tests.el: Require cl-lib at runtime too. | ||
| 4 | (ert-test-special-operator-p): Use cl-gensym rather than ert-- version. | ||
| 5 | (ert-test-remprop, ert-test-remove-if-not, ert-test-remove*) | ||
| 6 | (ert-test-set-functions, ert-test-gensym) | ||
| 7 | (ert-test-coerce-to-vector, ert-test-string-position) | ||
| 8 | (ert-test-mismatch): Remove tests. | ||
| 9 | * automated/cl-lib.el: New, split from ert-tests.el. | ||
| 10 | |||
| 3 | * automated/ruby-mode-tests.el (ruby-deftest-move-to-block): | 11 | * automated/ruby-mode-tests.el (ruby-deftest-move-to-block): |
| 4 | Goto point-min. | 12 | Goto point-min. |
| 5 | (works-on-do, zero-is-noop, ok-with-three, ok-with-minus-two) | 13 | (works-on-do, zero-is-noop, ok-with-three, ok-with-minus-two) |
diff --git a/test/automated/cl-lib.el b/test/automated/cl-lib.el new file mode 100644 index 00000000000..3a339e01734 --- /dev/null +++ b/test/automated/cl-lib.el | |||
| @@ -0,0 +1,198 @@ | |||
| 1 | ;;; cl-lib.el --- tests for emacs-lisp/cl-lib.el | ||
| 2 | |||
| 3 | ;; Copyright (C) 2013 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; This program is free software: you can redistribute it and/or | ||
| 8 | ;; modify it under the terms of the GNU General Public License as | ||
| 9 | ;; published by the Free Software Foundation, either version 3 of the | ||
| 10 | ;; License, or (at your option) any later version. | ||
| 11 | ;; | ||
| 12 | ;; This program is distributed in the hope that it will be useful, but | ||
| 13 | ;; WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 15 | ;; General Public License for more details. | ||
| 16 | ;; | ||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with this program. If not, see `http://www.gnu.org/licenses/'. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;; Extracted from ert-tests.el, back when ert used to reimplement some | ||
| 23 | ;; cl functions. | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (require 'cl-lib) | ||
| 28 | (require 'ert) | ||
| 29 | |||
| 30 | (ert-deftest cl-lib-test-remprop () | ||
| 31 | (let ((x (cl-gensym))) | ||
| 32 | (should (equal (symbol-plist x) '())) | ||
| 33 | ;; Remove nonexistent property on empty plist. | ||
| 34 | (cl-remprop x 'b) | ||
| 35 | (should (equal (symbol-plist x) '())) | ||
| 36 | (put x 'a 1) | ||
| 37 | (should (equal (symbol-plist x) '(a 1))) | ||
| 38 | ;; Remove nonexistent property on nonempty plist. | ||
| 39 | (cl-remprop x 'b) | ||
| 40 | (should (equal (symbol-plist x) '(a 1))) | ||
| 41 | (put x 'b 2) | ||
| 42 | (put x 'c 3) | ||
| 43 | (put x 'd 4) | ||
| 44 | (should (equal (symbol-plist x) '(a 1 b 2 c 3 d 4))) | ||
| 45 | ;; Remove property that is neither first nor last. | ||
| 46 | (cl-remprop x 'c) | ||
| 47 | (should (equal (symbol-plist x) '(a 1 b 2 d 4))) | ||
| 48 | ;; Remove last property from a plist of length >1. | ||
| 49 | (cl-remprop x 'd) | ||
| 50 | (should (equal (symbol-plist x) '(a 1 b 2))) | ||
| 51 | ;; Remove first property from a plist of length >1. | ||
| 52 | (cl-remprop x 'a) | ||
| 53 | (should (equal (symbol-plist x) '(b 2))) | ||
| 54 | ;; Remove property when there is only one. | ||
| 55 | (cl-remprop x 'b) | ||
| 56 | (should (equal (symbol-plist x) '())))) | ||
| 57 | |||
| 58 | (ert-deftest cl-lib-test-remove-if-not () | ||
| 59 | (let ((list (list 'a 'b 'c 'd)) | ||
| 60 | (i 0)) | ||
| 61 | (let ((result (cl-remove-if-not (lambda (x) | ||
| 62 | (should (eql x (nth i list))) | ||
| 63 | (cl-incf i) | ||
| 64 | (member i '(2 3))) | ||
| 65 | list))) | ||
| 66 | (should (equal i 4)) | ||
| 67 | (should (equal result '(b c))) | ||
| 68 | (should (equal list '(a b c d))))) | ||
| 69 | (should (equal '() | ||
| 70 | (cl-remove-if-not (lambda (_x) (should nil)) '())))) | ||
| 71 | |||
| 72 | (ert-deftest cl-lib-test-remove () | ||
| 73 | (let ((list (list 'a 'b 'c 'd)) | ||
| 74 | (key-index 0) | ||
| 75 | (test-index 0)) | ||
| 76 | (let ((result | ||
| 77 | (cl-remove 'foo list | ||
| 78 | :key (lambda (x) | ||
| 79 | (should (eql x (nth key-index list))) | ||
| 80 | (prog1 | ||
| 81 | (list key-index x) | ||
| 82 | (cl-incf key-index))) | ||
| 83 | :test | ||
| 84 | (lambda (a b) | ||
| 85 | (should (eql a 'foo)) | ||
| 86 | (should (equal b (list test-index | ||
| 87 | (nth test-index list)))) | ||
| 88 | (cl-incf test-index) | ||
| 89 | (member test-index '(2 3)))))) | ||
| 90 | (should (equal key-index 4)) | ||
| 91 | (should (equal test-index 4)) | ||
| 92 | (should (equal result '(a d))) | ||
| 93 | (should (equal list '(a b c d))))) | ||
| 94 | (let ((x (cons nil nil)) | ||
| 95 | (y (cons nil nil))) | ||
| 96 | (should (equal (cl-remove x (list x y)) | ||
| 97 | ;; or (list x), since we use `equal' -- the | ||
| 98 | ;; important thing is that only one element got | ||
| 99 | ;; removed, this proves that the default test is | ||
| 100 | ;; `eql', not `equal' | ||
| 101 | (list y))))) | ||
| 102 | |||
| 103 | |||
| 104 | (ert-deftest cl-lib-test-set-functions () | ||
| 105 | (let ((c1 (cons nil nil)) | ||
| 106 | (c2 (cons nil nil)) | ||
| 107 | (sym (make-symbol "a"))) | ||
| 108 | (let ((e '()) | ||
| 109 | (a (list 'a 'b sym nil "" "x" c1 c2)) | ||
| 110 | (b (list c1 'y 'b sym 'x))) | ||
| 111 | (should (equal (cl-set-difference e e) e)) | ||
| 112 | (should (equal (cl-set-difference a e) a)) | ||
| 113 | (should (equal (cl-set-difference e a) e)) | ||
| 114 | (should (equal (cl-set-difference a a) e)) | ||
| 115 | (should (equal (cl-set-difference b e) b)) | ||
| 116 | (should (equal (cl-set-difference e b) e)) | ||
| 117 | (should (equal (cl-set-difference b b) e)) | ||
| 118 | ;; Note: this test (and others) is sensitive to the order of the | ||
| 119 | ;; result, which is not documented. | ||
| 120 | (should (equal (cl-set-difference a b) (list c2 "x" "" nil 'a))) | ||
| 121 | (should (equal (cl-set-difference b a) (list 'x 'y))) | ||
| 122 | |||
| 123 | ;; We aren't testing whether this is really using `eq' rather than `eql'. | ||
| 124 | (should (equal (cl-set-difference e e :test 'eq) e)) | ||
| 125 | (should (equal (cl-set-difference a e :test 'eq) a)) | ||
| 126 | (should (equal (cl-set-difference e a :test 'eq) e)) | ||
| 127 | (should (equal (cl-set-difference a a :test 'eq) e)) | ||
| 128 | (should (equal (cl-set-difference b e :test 'eq) b)) | ||
| 129 | (should (equal (cl-set-difference e b :test 'eq) e)) | ||
| 130 | (should (equal (cl-set-difference b b :test 'eq) e)) | ||
| 131 | (should (equal (cl-set-difference a b :test 'eq) (list c2 "x" "" nil 'a))) | ||
| 132 | (should (equal (cl-set-difference b a :test 'eq) (list 'x 'y))) | ||
| 133 | |||
| 134 | (should (equal (cl-union e e) e)) | ||
| 135 | (should (equal (cl-union a e) a)) | ||
| 136 | (should (equal (cl-union e a) a)) | ||
| 137 | (should (equal (cl-union a a) a)) | ||
| 138 | (should (equal (cl-union b e) b)) | ||
| 139 | (should (equal (cl-union e b) b)) | ||
| 140 | (should (equal (cl-union b b) b)) | ||
| 141 | (should (equal (cl-union a b) (list 'x 'y 'a 'b sym nil "" "x" c1 c2))) | ||
| 142 | |||
| 143 | (should (equal (cl-union b a) (list 'x 'y 'a 'b sym nil "" "x" c1 c2))) | ||
| 144 | |||
| 145 | (should (equal (cl-intersection e e) e)) | ||
| 146 | (should (equal (cl-intersection a e) e)) | ||
| 147 | (should (equal (cl-intersection e a) e)) | ||
| 148 | (should (equal (cl-intersection a a) a)) | ||
| 149 | (should (equal (cl-intersection b e) e)) | ||
| 150 | (should (equal (cl-intersection e b) e)) | ||
| 151 | (should (equal (cl-intersection b b) b)) | ||
| 152 | (should (equal (cl-intersection a b) (list sym 'b c1))) | ||
| 153 | (should (equal (cl-intersection b a) (list sym 'b c1)))))) | ||
| 154 | |||
| 155 | (ert-deftest cl-lib-test-gensym () | ||
| 156 | ;; Since the expansion of `should' calls `cl-gensym' and thus has a | ||
| 157 | ;; side-effect on `cl--gensym-counter', we have to make sure all | ||
| 158 | ;; macros in our test body are expanded before we rebind | ||
| 159 | ;; `cl--gensym-counter' and run the body. Otherwise, the test would | ||
| 160 | ;; fail if run interpreted. | ||
| 161 | (let ((body (byte-compile | ||
| 162 | '(lambda () | ||
| 163 | (should (equal (symbol-name (cl-gensym)) "G0")) | ||
| 164 | (should (equal (symbol-name (cl-gensym)) "G1")) | ||
| 165 | (should (equal (symbol-name (cl-gensym)) "G2")) | ||
| 166 | (should (equal (symbol-name (cl-gensym "foo")) "foo3")) | ||
| 167 | (should (equal (symbol-name (cl-gensym "bar")) "bar4")) | ||
| 168 | (should (equal cl--gensym-counter 5)))))) | ||
| 169 | (let ((cl--gensym-counter 0)) | ||
| 170 | (funcall body)))) | ||
| 171 | |||
| 172 | (ert-deftest cl-lib-test-coerce-to-vector () | ||
| 173 | (let* ((a (vector)) | ||
| 174 | (b (vector 1 a 3)) | ||
| 175 | (c (list)) | ||
| 176 | (d (list b a))) | ||
| 177 | (should (eql (cl-coerce a 'vector) a)) | ||
| 178 | (should (eql (cl-coerce b 'vector) b)) | ||
| 179 | (should (equal (cl-coerce c 'vector) (vector))) | ||
| 180 | (should (equal (cl-coerce d 'vector) (vector b a))))) | ||
| 181 | |||
| 182 | (ert-deftest cl-lib-test-string-position () | ||
| 183 | (should (eql (cl-position ?x "") nil)) | ||
| 184 | (should (eql (cl-position ?a "abc") 0)) | ||
| 185 | (should (eql (cl-position ?b "abc") 1)) | ||
| 186 | (should (eql (cl-position ?c "abc") 2)) | ||
| 187 | (should (eql (cl-position ?d "abc") nil)) | ||
| 188 | (should (eql (cl-position ?A "abc") nil))) | ||
| 189 | |||
| 190 | (ert-deftest cl-lib-test-mismatch () | ||
| 191 | (should (eql (cl-mismatch "" "") nil)) | ||
| 192 | (should (eql (cl-mismatch "" "a") 0)) | ||
| 193 | (should (eql (cl-mismatch "a" "a") nil)) | ||
| 194 | (should (eql (cl-mismatch "ab" "a") 1)) | ||
| 195 | (should (eql (cl-mismatch "Aa" "aA") 0)) | ||
| 196 | (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) | ||
| 197 | |||
| 198 | ;;; cl-lib.el ends here | ||
diff --git a/test/automated/ert-tests.el b/test/automated/ert-tests.el index 0c3c3692c1d..36864377ec9 100644 --- a/test/automated/ert-tests.el +++ b/test/automated/ert-tests.el | |||
| @@ -26,11 +26,9 @@ | |||
| 26 | 26 | ||
| 27 | ;;; Code: | 27 | ;;; Code: |
| 28 | 28 | ||
| 29 | (eval-when-compile | 29 | (require 'cl-lib) |
| 30 | (require 'cl-lib)) | ||
| 31 | (require 'ert) | 30 | (require 'ert) |
| 32 | 31 | ||
| 33 | |||
| 34 | ;;; Self-test that doesn't rely on ERT, for bootstrapping. | 32 | ;;; Self-test that doesn't rely on ERT, for bootstrapping. |
| 35 | 33 | ||
| 36 | ;; This is used to test that bodies actually run. | 34 | ;; This is used to test that bodies actually run. |
| @@ -578,7 +576,7 @@ This macro is used to test if macroexpansion in `should' works." | |||
| 578 | (should (ert--special-operator-p 'if)) | 576 | (should (ert--special-operator-p 'if)) |
| 579 | (should-not (ert--special-operator-p 'car)) | 577 | (should-not (ert--special-operator-p 'car)) |
| 580 | (should-not (ert--special-operator-p 'ert--special-operator-p)) | 578 | (should-not (ert--special-operator-p 'ert--special-operator-p)) |
| 581 | (let ((b (ert--gensym))) | 579 | (let ((b (cl-gensym))) |
| 582 | (should-not (ert--special-operator-p b)) | 580 | (should-not (ert--special-operator-p b)) |
| 583 | (fset b 'if) | 581 | (fset b 'if) |
| 584 | (should (ert--special-operator-p b)))) | 582 | (should (ert--special-operator-p b)))) |
| @@ -626,171 +624,6 @@ This macro is used to test if macroexpansion in `should' works." | |||
| 626 | :explanation nil) | 624 | :explanation nil) |
| 627 | )))))) | 625 | )))))) |
| 628 | 626 | ||
| 629 | (ert-deftest ert-test-remprop () | ||
| 630 | (let ((x (ert--gensym))) | ||
| 631 | (should (equal (symbol-plist x) '())) | ||
| 632 | ;; Remove nonexistent property on empty plist. | ||
| 633 | (ert--remprop x 'b) | ||
| 634 | (should (equal (symbol-plist x) '())) | ||
| 635 | (put x 'a 1) | ||
| 636 | (should (equal (symbol-plist x) '(a 1))) | ||
| 637 | ;; Remove nonexistent property on nonempty plist. | ||
| 638 | (ert--remprop x 'b) | ||
| 639 | (should (equal (symbol-plist x) '(a 1))) | ||
| 640 | (put x 'b 2) | ||
| 641 | (put x 'c 3) | ||
| 642 | (put x 'd 4) | ||
| 643 | (should (equal (symbol-plist x) '(a 1 b 2 c 3 d 4))) | ||
| 644 | ;; Remove property that is neither first nor last. | ||
| 645 | (ert--remprop x 'c) | ||
| 646 | (should (equal (symbol-plist x) '(a 1 b 2 d 4))) | ||
| 647 | ;; Remove last property from a plist of length >1. | ||
| 648 | (ert--remprop x 'd) | ||
| 649 | (should (equal (symbol-plist x) '(a 1 b 2))) | ||
| 650 | ;; Remove first property from a plist of length >1. | ||
| 651 | (ert--remprop x 'a) | ||
| 652 | (should (equal (symbol-plist x) '(b 2))) | ||
| 653 | ;; Remove property when there is only one. | ||
| 654 | (ert--remprop x 'b) | ||
| 655 | (should (equal (symbol-plist x) '())))) | ||
| 656 | |||
| 657 | (ert-deftest ert-test-remove-if-not () | ||
| 658 | (let ((list (list 'a 'b 'c 'd)) | ||
| 659 | (i 0)) | ||
| 660 | (let ((result (ert--remove-if-not (lambda (x) | ||
| 661 | (should (eql x (nth i list))) | ||
| 662 | (cl-incf i) | ||
| 663 | (member i '(2 3))) | ||
| 664 | list))) | ||
| 665 | (should (equal i 4)) | ||
| 666 | (should (equal result '(b c))) | ||
| 667 | (should (equal list '(a b c d))))) | ||
| 668 | (should (equal '() | ||
| 669 | (ert--remove-if-not (lambda (_x) (should nil)) '())))) | ||
| 670 | |||
| 671 | (ert-deftest ert-test-remove* () | ||
| 672 | (let ((list (list 'a 'b 'c 'd)) | ||
| 673 | (key-index 0) | ||
| 674 | (test-index 0)) | ||
| 675 | (let ((result | ||
| 676 | (ert--remove* 'foo list | ||
| 677 | :key (lambda (x) | ||
| 678 | (should (eql x (nth key-index list))) | ||
| 679 | (prog1 | ||
| 680 | (list key-index x) | ||
| 681 | (cl-incf key-index))) | ||
| 682 | :test | ||
| 683 | (lambda (a b) | ||
| 684 | (should (eql a 'foo)) | ||
| 685 | (should (equal b (list test-index | ||
| 686 | (nth test-index list)))) | ||
| 687 | (cl-incf test-index) | ||
| 688 | (member test-index '(2 3)))))) | ||
| 689 | (should (equal key-index 4)) | ||
| 690 | (should (equal test-index 4)) | ||
| 691 | (should (equal result '(a d))) | ||
| 692 | (should (equal list '(a b c d))))) | ||
| 693 | (let ((x (cons nil nil)) | ||
| 694 | (y (cons nil nil))) | ||
| 695 | (should (equal (ert--remove* x (list x y)) | ||
| 696 | ;; or (list x), since we use `equal' -- the | ||
| 697 | ;; important thing is that only one element got | ||
| 698 | ;; removed, this proves that the default test is | ||
| 699 | ;; `eql', not `equal' | ||
| 700 | (list y))))) | ||
| 701 | |||
| 702 | |||
| 703 | (ert-deftest ert-test-set-functions () | ||
| 704 | (let ((c1 (cons nil nil)) | ||
| 705 | (c2 (cons nil nil)) | ||
| 706 | (sym (make-symbol "a"))) | ||
| 707 | (let ((e '()) | ||
| 708 | (a (list 'a 'b sym nil "" "x" c1 c2)) | ||
| 709 | (b (list c1 'y 'b sym 'x))) | ||
| 710 | (should (equal (ert--set-difference e e) e)) | ||
| 711 | (should (equal (ert--set-difference a e) a)) | ||
| 712 | (should (equal (ert--set-difference e a) e)) | ||
| 713 | (should (equal (ert--set-difference a a) e)) | ||
| 714 | (should (equal (ert--set-difference b e) b)) | ||
| 715 | (should (equal (ert--set-difference e b) e)) | ||
| 716 | (should (equal (ert--set-difference b b) e)) | ||
| 717 | (should (equal (ert--set-difference a b) (list 'a nil "" "x" c2))) | ||
| 718 | (should (equal (ert--set-difference b a) (list 'y 'x))) | ||
| 719 | |||
| 720 | ;; We aren't testing whether this is really using `eq' rather than `eql'. | ||
| 721 | (should (equal (ert--set-difference-eq e e) e)) | ||
| 722 | (should (equal (ert--set-difference-eq a e) a)) | ||
| 723 | (should (equal (ert--set-difference-eq e a) e)) | ||
| 724 | (should (equal (ert--set-difference-eq a a) e)) | ||
| 725 | (should (equal (ert--set-difference-eq b e) b)) | ||
| 726 | (should (equal (ert--set-difference-eq e b) e)) | ||
| 727 | (should (equal (ert--set-difference-eq b b) e)) | ||
| 728 | (should (equal (ert--set-difference-eq a b) (list 'a nil "" "x" c2))) | ||
| 729 | (should (equal (ert--set-difference-eq b a) (list 'y 'x))) | ||
| 730 | |||
| 731 | (should (equal (ert--union e e) e)) | ||
| 732 | (should (equal (ert--union a e) a)) | ||
| 733 | (should (equal (ert--union e a) a)) | ||
| 734 | (should (equal (ert--union a a) a)) | ||
| 735 | (should (equal (ert--union b e) b)) | ||
| 736 | (should (equal (ert--union e b) b)) | ||
| 737 | (should (equal (ert--union b b) b)) | ||
| 738 | (should (equal (ert--union a b) (list 'a 'b sym nil "" "x" c1 c2 'y 'x))) | ||
| 739 | (should (equal (ert--union b a) (list c1 'y 'b sym 'x 'a nil "" "x" c2))) | ||
| 740 | |||
| 741 | (should (equal (ert--intersection e e) e)) | ||
| 742 | (should (equal (ert--intersection a e) e)) | ||
| 743 | (should (equal (ert--intersection e a) e)) | ||
| 744 | (should (equal (ert--intersection a a) a)) | ||
| 745 | (should (equal (ert--intersection b e) e)) | ||
| 746 | (should (equal (ert--intersection e b) e)) | ||
| 747 | (should (equal (ert--intersection b b) b)) | ||
| 748 | (should (equal (ert--intersection a b) (list 'b sym c1))) | ||
| 749 | (should (equal (ert--intersection b a) (list c1 'b sym)))))) | ||
| 750 | |||
| 751 | (ert-deftest ert-test-gensym () | ||
| 752 | ;; Since the expansion of `should' calls `ert--gensym' and thus has a | ||
| 753 | ;; side-effect on `ert--gensym-counter', we have to make sure all | ||
| 754 | ;; macros in our test body are expanded before we rebind | ||
| 755 | ;; `ert--gensym-counter' and run the body. Otherwise, the test would | ||
| 756 | ;; fail if run interpreted. | ||
| 757 | (let ((body (byte-compile | ||
| 758 | '(lambda () | ||
| 759 | (should (equal (symbol-name (ert--gensym)) "G0")) | ||
| 760 | (should (equal (symbol-name (ert--gensym)) "G1")) | ||
| 761 | (should (equal (symbol-name (ert--gensym)) "G2")) | ||
| 762 | (should (equal (symbol-name (ert--gensym "foo")) "foo3")) | ||
| 763 | (should (equal (symbol-name (ert--gensym "bar")) "bar4")) | ||
| 764 | (should (equal ert--gensym-counter 5)))))) | ||
| 765 | (let ((ert--gensym-counter 0)) | ||
| 766 | (funcall body)))) | ||
| 767 | |||
| 768 | (ert-deftest ert-test-coerce-to-vector () | ||
| 769 | (let* ((a (vector)) | ||
| 770 | (b (vector 1 a 3)) | ||
| 771 | (c (list)) | ||
| 772 | (d (list b a))) | ||
| 773 | (should (eql (ert--coerce-to-vector a) a)) | ||
| 774 | (should (eql (ert--coerce-to-vector b) b)) | ||
| 775 | (should (equal (ert--coerce-to-vector c) (vector))) | ||
| 776 | (should (equal (ert--coerce-to-vector d) (vector b a))))) | ||
| 777 | |||
| 778 | (ert-deftest ert-test-string-position () | ||
| 779 | (should (eql (ert--string-position ?x "") nil)) | ||
| 780 | (should (eql (ert--string-position ?a "abc") 0)) | ||
| 781 | (should (eql (ert--string-position ?b "abc") 1)) | ||
| 782 | (should (eql (ert--string-position ?c "abc") 2)) | ||
| 783 | (should (eql (ert--string-position ?d "abc") nil)) | ||
| 784 | (should (eql (ert--string-position ?A "abc") nil))) | ||
| 785 | |||
| 786 | (ert-deftest ert-test-mismatch () | ||
| 787 | (should (eql (ert--mismatch "" "") nil)) | ||
| 788 | (should (eql (ert--mismatch "" "a") 0)) | ||
| 789 | (should (eql (ert--mismatch "a" "a") nil)) | ||
| 790 | (should (eql (ert--mismatch "ab" "a") 1)) | ||
| 791 | (should (eql (ert--mismatch "Aa" "aA") 0)) | ||
| 792 | (should (eql (ert--mismatch '(a b c) '(a b d)) 2))) | ||
| 793 | |||
| 794 | (ert-deftest ert-test-string-first-line () | 627 | (ert-deftest ert-test-string-first-line () |
| 795 | (should (equal (ert--string-first-line "") "")) | 628 | (should (equal (ert--string-first-line "") "")) |
| 796 | (should (equal (ert--string-first-line "abc") "abc")) | 629 | (should (equal (ert--string-first-line "abc") "abc")) |