|
@@ -1279,7 +1279,21 @@ Outside list"
|
|
|
"Test `table' parser."
|
|
|
(should
|
|
|
(org-test-with-temp-text "| a |"
|
|
|
- (org-element-map (org-element-parse-buffer) 'table 'identity))))
|
|
|
+ (org-element-map (org-element-parse-buffer) 'table 'identity)))
|
|
|
+ ;; TBLFM keyword is case insensitive.
|
|
|
+ (should
|
|
|
+ (org-test-with-temp-text "| a |\n#+tblfm: test"
|
|
|
+ (org-element-property
|
|
|
+ :tblfm
|
|
|
+ (org-element-map (org-element-parse-buffer) 'table 'identity nil t))))
|
|
|
+ ;; Handle multiple TBLFM lines.
|
|
|
+ (should
|
|
|
+ (= 2
|
|
|
+ (org-test-with-temp-text "| a |\n#+TBLFM: test1\n#+TBLFM: test2"
|
|
|
+ (length (org-element-property
|
|
|
+ :tblfm
|
|
|
+ (org-element-map
|
|
|
+ (org-element-parse-buffer) 'table 'identity nil t)))))))
|
|
|
|
|
|
|
|
|
;;;; Table Cell
|
|
@@ -1293,7 +1307,7 @@ Outside list"
|
|
|
|
|
|
;;;; Table Row
|
|
|
|
|
|
-(ert-deftest test-org-element/table-parser ()
|
|
|
+(ert-deftest test-org-element/table-row-parser ()
|
|
|
"Test `table-row' parser."
|
|
|
(should
|
|
|
(equal '(standard rule)
|
|
@@ -1702,18 +1716,23 @@ CLOSED: <2012-01-01> DEADLINE: <2012-01-01> SCHEDULED: <2012-01-01>\n"))))
|
|
|
;; 1. Simple table.
|
|
|
(should (equal (org-test-parse-and-interpret "| a | b |\n| c | d |")
|
|
|
"| a | b |\n| c | d |\n"))
|
|
|
- ;; 2. Table with horizontal rules.
|
|
|
+ ;; 2. With horizontal rules.
|
|
|
(should (equal (org-test-parse-and-interpret
|
|
|
"| a | b |\n|---+---|\n| c | d |")
|
|
|
"| a | b |\n|---+---|\n| c | d |\n"))
|
|
|
- ;; 3. Table with meta-data.
|
|
|
+ ;; 3. With meta-data.
|
|
|
(should (equal (org-test-parse-and-interpret "| / | < | > |\n| * | 1 | 2 |")
|
|
|
"| / | < | > |\n| * | 1 | 2 |\n"))
|
|
|
;; 4. With a formula.
|
|
|
(should
|
|
|
(equal (org-test-parse-and-interpret
|
|
|
"| 2 |\n| 4 |\n| 3 |\n#+TBLFM: @3=vmean(@1..@2)")
|
|
|
- "| 2 |\n| 4 |\n| 3 |\n#+TBLFM: @3=vmean(@1..@2)\n")))
|
|
|
+ "| 2 |\n| 4 |\n| 3 |\n#+TBLFM: @3=vmean(@1..@2)\n"))
|
|
|
+ ;; 5. With multiple formulas.
|
|
|
+ (should
|
|
|
+ (equal (org-test-parse-and-interpret
|
|
|
+ "| 2 |\n| 4 |\n| 3 |\n#+TBLFM: test1\n#+TBLFM: test2")
|
|
|
+ "| 2 |\n| 4 |\n| 3 |\n#+TBLFM: test1\n#+TBLFM: test2\n")))
|
|
|
|
|
|
(ert-deftest test-org-element/verse-block-interpreter ()
|
|
|
"Test verse block interpretation."
|