diff options
| author | Ihor Radchenko <yantar92@posteo.net> | 2024-05-02 15:24:15 +0300 |
|---|---|---|
| committer | Ihor Radchenko <yantar92@posteo.net> | 2024-05-02 15:24:15 +0300 |
| commit | dd12e9c763097c8b06295330544246b49c9bd39d (patch) | |
| tree | 1ece6234f9befea3f829724474373eab12b03040 /testing/lisp/test-ob-calc.el | |
| parent | a2e5685e49de8ad8dd5823de24c28131fcc309a8 (diff) | |
ob-calc.el: Fix assigning floating point numbers
* lisp/ob-calc.el (org-babel-execute:calc): Use internal calc format
when assigning variable values that are numbers.
* testing/lisp/test-ob-calc.el (ob-calc/float-var): New test.
Reported-by: Visuwesh <visuweshm@gmail.com>
Link: https://orgmode.org/list/87edbu4kdh.fsf@gmail.com
Diffstat (limited to 'testing/lisp/test-ob-calc.el')
| -rw-r--r-- | testing/lisp/test-ob-calc.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testing/lisp/test-ob-calc.el b/testing/lisp/test-ob-calc.el index 6d6ca10..bfe41eb 100644 --- a/testing/lisp/test-ob-calc.el +++ b/testing/lisp/test-ob-calc.el @@ -39,6 +39,14 @@ #+END_SRC" (should (equal "27" (org-babel-execute-src-block))))) +(ert-deftest ob-calc/float-var () + "Test of floating variable." + (org-test-with-temp-text "\ +#+BEGIN_SRC calc :results silent :var x=2.0 + 1/x +#+END_SRC" + (should (equal "0.5" (org-babel-execute-src-block))))) + (ert-deftest ob-calc/simple-program-symbolic () "Test of simple symbolic algebra." (org-test-with-temp-text "\ |
