[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org b72b718 5/6: Add a test for known bug in org-elemen
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org b72b718 5/6: Add a test for known bug in org-element-cache |
Date: |
Sat, 15 May 2021 08:57:15 -0400 (EDT) |
branch: externals/org
commit b72b718ac6cc09990e30f398b903c9b70207ea6f
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Bastien <bzg@gnu.org>
Add a test for known bug in org-element-cache
* testing/lisp/test-org-element.el (test-org-element/cache-bugs): A
new test documenting a known bug:
1. Create initial file like:
P0
P1
| a | b |
<point>| c | d |
Note that second line of the table is not indented. Now,
org-element-at-point returns table-row.
2. Modify the file to test org-element-cache
P0
- item
P1
| a | b |
<point>| c | d |
Now, the first (indented) row of the table belongs to item. The
second row should be an individual table and org-element-at-point
returns table.
---
testing/lisp/test-org-element.el | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 28e9ecd..18991b5 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -3889,6 +3889,21 @@ Text
:end (org-element-property :parent (org-element-at-point)))
(+ parent-end 3))))))
+(ert-deftest test-org-element/cache-bugs ()
+ "Test basic expectations and common pitfalls for cache."
+ :expected-result :failed
+ ;; Unindented second row of the table should not be re-parented by
+ ;; inserted item.
+ (should
+ (eq 'table
+ (let ((org-element-use-cache t))
+ (org-test-with-temp-text
+ "#+begin_center\nP0\n\n<point>\n\n P1\n | a | b |\n| c | d
|\n#+end_center"
+ (save-excursion (search-forward "| c |") (org-element-at-point))
+ (insert "- item")
+ (search-forward "| c |")
+ (beginning-of-line)
+ (org-element-type (org-element-at-point)))))))
(provide 'test-org-element)
- [elpa] externals/org updated (8b0b206 -> 65de88b), ELPA Syncer, 2021/05/15
- [elpa] externals/org 405d82e 3/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org 65de88b 6/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org 937a0d8 4/6: Merge branch 'maint', ELPA Syncer, 2021/05/15
- [elpa] externals/org b72b718 5/6: Add a test for known bug in org-element-cache,
ELPA Syncer <=
- [elpa] externals/org 9e127a7 2/6: New command `org-refile-reverse' bound to C-c C-M-w, ELPA Syncer, 2021/05/15
- [elpa] externals/org ba27327 1/6: Use cache in org-up-heading-safe, ELPA Syncer, 2021/05/15