0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-09-05 01:43:33 +00:00
org-mode/testing/lisp/test-org-table.el
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00

67 lines
1.9 KiB
EmacsLisp
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;; test-org-table.el
;; Copyright (c) ߛ David Maus
;; Authors: David Maus
;; Released under the GNU General Public License version 3
;; see: http://www.gnu.org/licenses/gpl-3.0.html
;;;; Comments:
;; Template test file for Org-mode tests
;;; Code:
(let ((load-path (cons (expand-file-name
".." (file-name-directory
(or load-file-name buffer-file-name)))
load-path)))
(require 'org-test)
(require 'org-test-ob-consts))
;;; Tests
(ert-deftest test-org-table/org-table-convert-refs-to-an/1 ()
"Simple reference @1$1."
(should
(string= "A1" (org-table-convert-refs-to-an "@1$1"))))
;; TODO: Test broken
;; (ert-deftest test-org-table/org-table-convert-refs-to-an/2 ()
;; "Self reference @1$1."
;; (should
;; (string= "A1 = $0" (org-table-convert-refs-to-an "@1$1 = $0"))))
(ert-deftest test-org-table/org-table-convert-refs-to-an/3 ()
"Remote reference."
(should
(string= "C& = remote(FOO, @@#B&)" (org-table-convert-refs-to-an "$3 = remote(FOO, @@#$2)"))))
(ert-deftest test-org-table/org-table-convert-refs-to-rc/1 ()
"Simple reference @1$1."
(should
(string= "@1$1" (org-table-convert-refs-to-rc "A1"))))
(ert-deftest test-org-table/org-table-convert-refs-to-rc/2 ()
"Self reference $0."
(should
(string= "@1$1 = $0" (org-table-convert-refs-to-rc "A1 = $0"))))
;; TODO: Test Broken
;; (ert-deftest test-org-table/org-table-convert-refs-to-rc/3 ()
;; "Remote reference."
;; (should
;; (string= "$3 = remote(FOO, @@#$2)" (org-table-convert-refs-to-rc "C& = remote(FOO, @@#B&)"))))
(ert-deftest test-org-table/simple-formula ()
(org-test-at-id "563523f7-3f3e-49c9-9622-9216cc9a5d95"
(re-search-forward (regexp-quote "#+tblname: simple-formula") nil t)
(forward-line 1)
(should (org-at-table-p))
(should (org-table-recalculate 'all))
(should (string= "10" (first (nth 5 (org-table-to-lisp)))))))
(provide 'test-org-table)
;;; test-org-table.el ends here