diff options
| author | Mattias EngdegÄrd | 2019-12-26 19:37:10 +0100 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-12-26 19:37:10 +0100 |
| commit | cd559841537726315d72a303447140f71e34f635 (patch) | |
| tree | 144f2d9569876ecadc816192ea5b24ed599ca5b2 /test | |
| parent | e8aa6f19e99e5de9a3953fef8ae50e2363531b3d (diff) | |
| download | emacs-cd559841537726315d72a303447140f71e34f635.tar.gz emacs-cd559841537726315d72a303447140f71e34f635.zip | |
Calc: add missing dynamic variable declarations
* lisp/calc/calc-alg.el (math-simplify-only, calc-simplify-mode)
(math-expand-formulas, calc-poly-div-remainder)
(math-living-dangerously, math-simplifying, calc-angle-mode)
(calc-prefer-frac, math-poly-base-variable):
Declare dynamic variables.
* test/lisp/calc/calc-tests.el (calc-poly-div):
Add test for at least one bug caused by missing declarations.
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/calc/calc-tests.el | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 3f5adceeff1..33e6b14827f 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el | |||
| @@ -318,6 +318,21 @@ An existing calc stack is reused, otherwise a new one is created." | |||
| 318 | '(vec (calcFunc-eq (var x var-x) 3) | 318 | '(vec (calcFunc-eq (var x var-x) 3) |
| 319 | (calcFunc-eq (var y var-y) 0))))) | 319 | (calcFunc-eq (var y var-y) 0))))) |
| 320 | 320 | ||
| 321 | (ert-deftest calc-poly-div () | ||
| 322 | "Test polynomial division, and that the remainder is recorded in the trail." | ||
| 323 | (with-current-buffer (calc-trail-buffer) | ||
| 324 | (let ((inhibit-read-only t)) | ||
| 325 | (erase-buffer) | ||
| 326 | |||
| 327 | (calc-eval "2x**3+1" 'push) | ||
| 328 | (calc-eval "x**2+2x" 'push) | ||
| 329 | (calc-poly-div nil) | ||
| 330 | (let ((tos (calc-top-n 1)) | ||
| 331 | (trail (buffer-string))) | ||
| 332 | (calc-pop 0) | ||
| 333 | (should (equal tos '(- (* 2 (var x var-x)) 4))) | ||
| 334 | (should (equal trail "pdiv 2 * x - 4\nprem 8 * x + 1\n")))))) | ||
| 335 | |||
| 321 | (provide 'calc-tests) | 336 | (provide 'calc-tests) |
| 322 | ;;; calc-tests.el ends here | 337 | ;;; calc-tests.el ends here |
| 323 | 338 | ||