[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org d8ac958836 4/4: ob-calc/matrix-inversion: Force `ca
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org d8ac958836 4/4: ob-calc/matrix-inversion: Force `calc-float-format' in the test |
Date: |
Thu, 2 May 2024 09:58:35 -0400 (EDT) |
branch: externals/org
commit d8ac958836737e004ff9ac6b1c4e21eed0802d31
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
ob-calc/matrix-inversion: Force `calc-float-format' in the test
* testing/lisp/test-ob-calc.el (ob-calc/matrix-inversion): When
testing, make sure that calc output follows the expected format.
This is needed on MacOS where Emacs defaults are not exactly the same.
Reported-by: Alexander Adolf <alexander.adolf@condition-alpha.com>
Link:
https://list.orgmode.org/orgmode/91dfeb0fed1a1fe0564e5eb9b95a409d@condition-alpha.com/
---
testing/lisp/test-ob-calc.el | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/testing/lisp/test-ob-calc.el b/testing/lisp/test-ob-calc.el
index bfe41eb3ae..12f97279f6 100644
--- a/testing/lisp/test-ob-calc.el
+++ b/testing/lisp/test-ob-calc.el
@@ -67,7 +67,14 @@
inv(a)
#+END_SRC "
(should (equal "[[-1, 0.625, -0.125], [0.25, -0.5, 0.25], [0.5, 0.125,
-0.125]]"
- (org-babel-execute-src-block)))))
+ (let ((calc-float-format '(float 0)))
+ ;; ;; Make sure that older Calc buffers are not present.
+ (save-current-buffer
+ (when (ignore-errors (calc-select-buffer))
+ (kill-buffer)))
+ ;; Now, let-bound `calc-float-format' will take
+ ;; effect.
+ (org-babel-execute-src-block))))))
(ert-deftest ob-calc/matrix-algebra ()
"Test of simple matrix algebra."