aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lisp/calc/calc-tests.el15
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