aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
Diffstat (limited to 'test/src')
-rw-r--r--test/src/data-tests.el36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/src/data-tests.el b/test/src/data-tests.el
index 28cee9d2c5b..680fdd57d71 100644
--- a/test/src/data-tests.el
+++ b/test/src/data-tests.el
@@ -772,4 +772,40 @@ comparing the subr with a much slower Lisp implementation."
772 "Can't set variable marked with 'make_symbol_constant'." 772 "Can't set variable marked with 'make_symbol_constant'."
773 (should-error (setq most-positive-fixnum 1) :type 'setting-constant)) 773 (should-error (setq most-positive-fixnum 1) :type 'setting-constant))
774 774
775(ert-deftest data-tests-fset ()
776 (fset 'data-tests--fs-fun (lambda () 'moo))
777 (declare-function data-tests--fs-fun nil)
778 (should (equal (data-tests--fs-fun) 'moo))
779
780 (fset 'data-tests--fs-fun1 'data-tests--fs-fun)
781 (declare-function data-tests--fs-fun1 nil)
782 (should (equal (data-tests--fs-fun1) 'moo))
783
784 (fset 'data-tests--fs-a 'data-tests--fs-b)
785 (fset 'data-tests--fs-b 'data-tests--fs-c)
786
787 (should-error (fset 'data-tests--fs-c 'data-tests--fs-c)
788 :type 'cyclic-function-indirection)
789 (fset 'data-tests--fs-d 'data-tests--fs-a)
790 (should-error (fset 'data-tests--fs-c 'data-tests--fs-d)
791 :type 'cyclic-function-indirection))
792
793(ert-deftest data-tests-defalias ()
794 (defalias 'data-tests--da-fun (lambda () 'baa))
795 (declare-function data-tests--da-fun nil)
796 (should (equal (data-tests--da-fun) 'baa))
797
798 (defalias 'data-tests--da-fun1 'data-tests--da-fun)
799 (declare-function data-tests--da-fun1 nil)
800 (should (equal (data-tests--da-fun1) 'baa))
801
802 (defalias 'data-tests--da-a 'data-tests--da-b)
803 (defalias 'data-tests--da-b 'data-tests--da-c)
804
805 (should-error (defalias 'data-tests--da-c 'data-tests--da-c)
806 :type 'cyclic-function-indirection)
807 (defalias 'data-tests--da-d 'data-tests--da-a)
808 (should-error (defalias 'data-tests--da-c 'data-tests--da-d)
809 :type 'cyclic-function-indirection))
810
775;;; data-tests.el ends here 811;;; data-tests.el ends here