diff options
| -rw-r--r-- | test/src/comp-test-funcs.el | 16 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/src/comp-test-funcs.el b/test/src/comp-test-funcs.el index 1b0f3056b98..bcf9fcb0fd1 100644 --- a/test/src/comp-test-funcs.el +++ b/test/src/comp-test-funcs.el | |||
| @@ -354,6 +354,22 @@ | |||
| 354 | comp-test-and-3-var | 354 | comp-test-and-3-var |
| 355 | 2)) | 355 | 2)) |
| 356 | 356 | ||
| 357 | (defun comp-test-copy-insn-f (insn) | ||
| 358 | ;; From `comp-copy-insn'. | ||
| 359 | (if (consp insn) | ||
| 360 | (let (result) | ||
| 361 | (while (consp insn) | ||
| 362 | (let ((newcar (car insn))) | ||
| 363 | (if (or (consp (car insn)) (comp-mvar-p (car insn))) | ||
| 364 | (setf newcar (comp-copy-insn (car insn)))) | ||
| 365 | (push newcar result)) | ||
| 366 | (setf insn (cdr insn))) | ||
| 367 | (nconc (nreverse result) | ||
| 368 | (if (comp-mvar-p insn) (comp-copy-insn insn) insn))) | ||
| 369 | (if (comp-mvar-p insn) | ||
| 370 | (copy-comp-mvar insn) | ||
| 371 | insn))) | ||
| 372 | |||
| 357 | 373 | ||
| 358 | ;;;;;;;;;;;;;;;;;;;; | 374 | ;;;;;;;;;;;;;;;;;;;; |
| 359 | ;; Tromey's tests ;; | 375 | ;; Tromey's tests ;; |
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 61838c670e1..b2f83998838 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -444,6 +444,11 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." | |||
| 444 | (should (= (comp-test-and-3-f t) 2)) | 444 | (should (= (comp-test-and-3-f t) 2)) |
| 445 | (should (null (comp-test-and-3-f '(1 2))))) | 445 | (should (null (comp-test-and-3-f '(1 2))))) |
| 446 | 446 | ||
| 447 | (comp-deftest copy-insn () | ||
| 448 | (should (equal (comp-test-copy-insn-f '(1 2 3 (4 5 6))) | ||
| 449 | '(1 2 3 (4 5 6)))) | ||
| 450 | (should (null (comp-test-copy-insn-f nil)))) | ||
| 451 | |||
| 447 | 452 | ||
| 448 | ;;;;;;;;;;;;;;;;;;;;; | 453 | ;;;;;;;;;;;;;;;;;;;;; |
| 449 | ;; Tromey's tests. ;; | 454 | ;; Tromey's tests. ;; |