Browse Source

Add test for table alignment

* testing/lisp/test-org-table.el (test-org-table/align-buffer-tables):
New test to document current behavior.
Michael Brand 8 năm trước cách đây
mục cha
commit
e66298dfd9
1 tập tin đã thay đổi với 22 bổ sung0 xóa
  1. 22 0
      testing/lisp/test-org-table.el

+ 22 - 0
testing/lisp/test-org-table.el

@@ -167,6 +167,28 @@
 |         ab |          ab |  ab |   ab |   ab |  ab |
 "))
 
+(ert-deftest test-org-table/align-buffer-tables ()
+  "Align all tables when updating buffer."
+  (let ((before "
+|  a  b  |
+
+|  c  d  |
+")
+	;; FIXME: Tables should be aligned.
+	(after "
+|  a  b  |
+
+|  c  d  |
+"))
+    (should (equal (org-test-with-temp-text before
+		     (org-table-recalculate-buffer-tables)
+		     (buffer-string))
+		   after))
+    (should (equal (org-test-with-temp-text before
+		     (org-table-iterate-buffer-tables)
+		     (buffer-string))
+		   after))))
+
 (defconst references/target-normal "
 | 0 | 1 | replace | replace | replace | replace | replace | replace |
 | z | 1 | replace | replace | replace | replace | replace | replace |