branch: externals/org
commit 88c3c7d7f9b0a8684ae004eab19adbb875479d14
Author: Morgan Smith <[email protected]>
Commit: Ihor Radchenko <[email protected]>
Testing: Refactor org-table test
* testing/lisp/test-org-table.el
(test-org-table/org-table-calc-current-TBLFM-when-stop-because-of-error):
Don't duplicate the test string. Don't create global variable `got'.
Don't print out the buffer-string (ert will do so if the test fails).
---
testing/lisp/test-org-table.el | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index 076b37a8f0..807ab7c84c 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -1292,28 +1292,19 @@ See also `test-org-table/copy-field'."
(ert-deftest
test-org-table/org-table-calc-current-TBLFM-when-stop-because-of-error ()
"org-table-calc-current-TBLFM should preserve the input as it was."
- (org-test-with-temp-text-in-file
- "
-| 1 | 1 |
-| 2 | 2 |
-#+TBLFM: $2=$1*1
-#+TBLFM: $2=$1*2::$2=$1*2
-#+TBLFM: $2=$1*3
-"
- (let ((expect "
+ (let ((expect "
| 1 | 1 |
| 2 | 2 |
#+TBLFM: $2=$1*1
#+TBLFM: $2=$1*2::$2=$1*2
#+TBLFM: $2=$1*3
"))
+ (org-test-with-temp-text-in-file
+ expect
(goto-char (point-min))
(forward-line 4)
(should-error (org-table-calc-current-TBLFM))
- (setq got (buffer-string))
- (message "%s" got)
- (should (string= got
- expect)))))
+ (should (string= (buffer-string) expect)))))
;;; Tables as Lisp