From: Stefan Kangas Date: Wed, 16 Aug 2023 07:14:49 +0000 (+0200) Subject: Add test for `calculator-exp` X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cf5ae0507e1a3aa956f0e588690371a63ab85e36;p=emacs.git Add test for `calculator-exp` * test/lisp/calculator-tests.el (calculator-expt): New test. --- diff --git a/test/lisp/calculator-tests.el b/test/lisp/calculator-tests.el index 7ac3b9ba37a..8786d5c6c3b 100644 --- a/test/lisp/calculator-tests.el +++ b/test/lisp/calculator-tests.el @@ -47,5 +47,11 @@ (let ((calculator-input-radix nil)) (should (equal (calculator-string-to-number str) expected))))))) +(ert-deftest calculator-expt () + (should (= (calculator-expt 2 -1) 0.5)) + (should (= (calculator-expt -2 2) 4)) + (should (= (calculator-expt -2 3) -8)) + (should (= (calculator-expt 2 64) 18446744073709551616))) + (provide 'calculator-tests) ;;; calculator-tests.el ends here