]> git.eshelyaron.com Git - emacs.git/commitdiff
Add test for `calculator-exp`
authorStefan Kangas <stefankangas@gmail.com>
Wed, 16 Aug 2023 07:14:49 +0000 (09:14 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Wed, 16 Aug 2023 19:27:50 +0000 (21:27 +0200)
* test/lisp/calculator-tests.el (calculator-expt): New test.

test/lisp/calculator-tests.el

index 7ac3b9ba37ae235f6faa9287bacb0a175ace834f..8786d5c6c3bea424caa54677f6da194da808da09 100644 (file)
        (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