Manually revert back to commit e85080.
[org-mode.git] / testing / lisp / test-org-table.el
blob3ecc3842972414d6c14685b5d8c415e8a473f938
1 ;;; test-org-table.el
3 ;; Copyright (c) ߛ David Maus
4 ;; Authors: David Maus
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
9 ;;;; Comments:
11 ;; Template test file for Org-mode tests
14 ;;; Code:
15 (let ((load-path (cons (expand-file-name
16 ".." (file-name-directory
17 (or load-file-name buffer-file-name)))
18 load-path)))
19 (require 'org-test)
20 (require 'org-test-ob-consts))
23 ;;; Tests
24 (ert-deftest test-org-table/org-table-convert-refs-to-an/1 ()
25 "Simple reference @1$1."
26 (should
27 (string= "A1" (org-table-convert-refs-to-an "@1$1"))))
29 ;; TODO: Test broken
30 ;; (ert-deftest test-org-table/org-table-convert-refs-to-an/2 ()
31 ;; "Self reference @1$1."
32 ;; (should
33 ;; (string= "A1 = $0" (org-table-convert-refs-to-an "@1$1 = $0"))))
35 (ert-deftest test-org-table/org-table-convert-refs-to-an/3 ()
36 "Remote reference."
37 (should
38 (string= "C& = remote(FOO, @@#B&)" (org-table-convert-refs-to-an "$3 = remote(FOO, @@#$2)"))))
40 (ert-deftest test-org-table/org-table-convert-refs-to-rc/1 ()
41 "Simple reference @1$1."
42 (should
43 (string= "@1$1" (org-table-convert-refs-to-rc "A1"))))
45 (ert-deftest test-org-table/org-table-convert-refs-to-rc/2 ()
46 "Self reference $0."
47 (should
48 (string= "@1$1 = $0" (org-table-convert-refs-to-rc "A1 = $0"))))
50 ;; TODO: Test Broken
51 ;; (ert-deftest test-org-table/org-table-convert-refs-to-rc/3 ()
52 ;; "Remote reference."
53 ;; (should
54 ;; (string= "$3 = remote(FOO, @@#$2)" (org-table-convert-refs-to-rc "C& = remote(FOO, @@#B&)"))))
56 (ert-deftest test-org-table/simple-formula ()
57 (org-test-at-id "563523f7-3f3e-49c9-9622-9216cc9a5d95"
58 (re-search-forward (regexp-quote "#+tblname: simple-formula") nil t)
59 (forward-line 1)
60 (should (org-at-table-p))
61 (should (org-table-recalculate 'all))
62 (should (string= "10" (first (nth 5 (org-table-to-lisp)))))))
64 (provide 'test-org-table)
66 ;;; test-org-table.el ends here