123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- (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"))))
- (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"))))
- (ert-deftest test-org-table/simple-formula ()
- (org-test-with-temp-text-in-file "
- * simple formula
- :PROPERTIES:
- :ID: 563523f7-3f3e-49c9-9622-9216cc9a5d95
- :END:
- #+tblname: simple-formula
- | 1 |
- | 2 |
- | 3 |
- | 4 |
- |----|
- | |
- #+TBLFM: $1=vsum(@1..@-1)
- "
- (progn
- (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)
|