From cf5ae0507e1a3aa956f0e588690371a63ab85e36 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 16 Aug 2023 09:14:49 +0200 Subject: [PATCH] Add test for `calculator-exp` * test/lisp/calculator-tests.el (calculator-expt): New test. --- test/lisp/calculator-tests.el | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5