aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/comp-tests.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el
index 926ba27e563..c5e5b346adb 100644
--- a/test/src/comp-tests.el
+++ b/test/src/comp-tests.el
@@ -446,7 +446,7 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
446 (should (equal comp-test-primitive-advice '(3 4)))) 446 (should (equal comp-test-primitive-advice '(3 4))))
447 (advice-remove #'+ f)))) 447 (advice-remove #'+ f))))
448 448
449(defvar comp-test-primitive-redefine-args) 449(defvar comp-test-primitive-redefine-args nil)
450(comp-deftest primitive-redefine () 450(comp-deftest primitive-redefine ()
451 "Test effectiveness of primitive redefinition." 451 "Test effectiveness of primitive redefinition."
452 (cl-letf ((comp-test-primitive-redefine-args nil) 452 (cl-letf ((comp-test-primitive-redefine-args nil)
@@ -532,6 +532,22 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html."
532 (should (subr-native-elisp-p 532 (should (subr-native-elisp-p
533 (symbol-function 'comp-test-48029-nonascii-žžž-f)))) 533 (symbol-function 'comp-test-48029-nonascii-žžž-f))))
534 534
535(comp-deftest 61917-1 ()
536 "Verify we can compile calls to redefined primitives with
537dedicated byte-op code."
538 (let (x
539 (f (lambda (fn &rest args)
540 (setq comp-test-primitive-redefine-args args))))
541 (advice-add #'delete-region :around f)
542 (unwind-protect
543 (setf x (native-compile
544 '(lambda ()
545 (delete-region 1 2))))
546 (should (subr-native-elisp-p x))
547 (funcall x)
548 (advice-remove #'delete-region f)
549 (should (equal comp-test-primitive-redefine-args '(1 2))))))
550
535 551
536;;;;;;;;;;;;;;;;;;;;; 552;;;;;;;;;;;;;;;;;;;;;
537;; Tromey's tests. ;; 553;; Tromey's tests. ;;