3 ;; Copyright (c) ߛ David Maus
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
11 ;; Template test file for Org-mode tests
14 (ert-deftest test-org-table
/org-table-convert-refs-to-an
/1 ()
15 "Simple reference @1$1."
17 (string= "A1" (org-table-convert-refs-to-an "@1$1"))))
20 ;; (ert-deftest test-org-table/org-table-convert-refs-to-an/2 ()
21 ;; "Self reference @1$1."
23 ;; (string= "A1 = $0" (org-table-convert-refs-to-an "@1$1 = $0"))))
25 (ert-deftest test-org-table
/org-table-convert-refs-to-an
/3 ()
28 (string= "C& = remote(FOO, @@#B&)" (org-table-convert-refs-to-an "$3 = remote(FOO, @@#$2)"))))
30 (ert-deftest test-org-table
/org-table-convert-refs-to-rc
/1 ()
31 "Simple reference @1$1."
33 (string= "@1$1" (org-table-convert-refs-to-rc "A1"))))
35 (ert-deftest test-org-table
/org-table-convert-refs-to-rc
/2 ()
38 (string= "@1$1 = $0" (org-table-convert-refs-to-rc "A1 = $0"))))
41 ;; (ert-deftest test-org-table/org-table-convert-refs-to-rc/3 ()
42 ;; "Remote reference."
44 ;; (string= "$3 = remote(FOO, @@#$2)" (org-table-convert-refs-to-rc "C& = remote(FOO, @@#B&)"))))
46 (ert-deftest test-org-table
/simple-formula
()
47 (org-test-with-temp-text-in-file "
51 :ID: 563523f7-3f3e-49c9-9622-9216cc9a5d95
54 #+tblname: simple-formula
61 #+TBLFM: $1=vsum(@1..@-1)
64 (re-search-forward (regexp-quote "#+tblname: simple-formula") nil t
)
66 (should (org-at-table-p))
67 (should (org-table-recalculate 'all
))
68 (should (string= "10" (first (nth 5 (org-table-to-lisp))))))))
70 (provide 'test-org-table
)
72 ;;; test-org-table.el ends here