]> git.eshelyaron.com Git - emacs.git/commitdiff
add native interactive support test
authorAndrea Corallo <akrl@sdf.org>
Sun, 8 Dec 2019 09:28:54 +0000 (10:28 +0100)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:38:12 +0000 (11:38 +0100)
test/src/comp-test-funcs.el
test/src/comp-tests.el

index 5e2fb0bd99a438e6b8ea4869719a49a635b92adb..cbf287838cbd9489a59d04779cde7f4840f6b413 100644 (file)
   "A nice docstring"
   t)
 
+(defun comp-test-interactive-form0-f (dir)
+  (interactive "D")
+  dir)
+
+(defun comp-test-interactive-form1-f (x y)
+  (interactive '(1 2))
+  (+ x y))
+
+(defun comp-test-interactive-form2-f ()
+  (interactive))
+
 \f
 ;;;;;;;;;;;;;;;;;;;;
 ;; Tromey's tests ;;
index 73c1fe14caa5142fc948931677d149e173aabeb2..230d5bfbdafa43b0a7d88cfc222c6bf0987fc4d0 100644 (file)
@@ -313,6 +313,18 @@ Check that the resulting binaries do not differ."
   (should (string= (symbol-file #'comp-tests-doc-f)
                    (concat comp-test-src "n"))))
 
+(ert-deftest comp-test-interactive-form ()
+  (should (equal (interactive-form #'comp-test-interactive-form0-f)
+                 '(interactive "D")))
+  (should (equal (interactive-form #'comp-test-interactive-form1-f)
+                 '(interactive '(1 2))))
+  (should (equal (interactive-form #'comp-test-interactive-form2-f)
+                 '(interactive nil)))
+  (should (cl-every #'commandp '(comp-test-interactive-form0-f
+                                 comp-test-interactive-form1-f
+                                 comp-test-interactive-form2-f)))
+  (should-not (commandp #'comp-tests-doc-f)))
+
 (ert-deftest comp-tests-free-fun ()
   "Check we are able to compile a single function."
   (defun comp-tests-free-fun-f ()