projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
33d3e5c
)
Add test for `calculator-exp`
author
Stefan Kangas
<stefankangas@gmail.com>
Wed, 16 Aug 2023 07:14:49 +0000
(09:14 +0200)
committer
Stefan 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
patch
|
blob
|
history
diff --git
a/test/lisp/calculator-tests.el
b/test/lisp/calculator-tests.el
index 7ac3b9ba37ae235f6faa9287bacb0a175ace834f..8786d5c6c3bea424caa54677f6da194da808da09 100644
(file)
--- 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