branch: externals/org-transclusion
commit 2fca5ecb6a976e4535e06d055168c931aac3d1f3
Author: gggion <[email protected]>
Commit: gggion <[email protected]>
docs: Add test files for org-transclusion-indent-mode changes
* test/test-indent-mode-source.org: New file with org structures for
testing fringe placement and persistence. Includes simple headings,
nested structures, lists, tables, code blocks, and quote blocks to cover
different transclusion scenarios.
* test/test-indent-mode-destination.org: New file with test cases
demonstrating correct fringe behavior. Test Case 1 verifies fringes
don't extend beyond actual transcluded content (the main bug that was
fixed). Other test cases cover complex nested structures, mid-level
headings, multiple sequential transclusions, transclusions within lists,
and special blocks. Includes instructions for testing in both graphical
and terminal modes, and a checklist of common issues we've fixed.
---
test/test-indent-mode-destination.org | 85 +++++++++++++++++++++++++++++++++++
test/test-indent-mode-source.org | 74 ++++++++++++++++++++++++++++++
2 files changed, 159 insertions(+)
diff --git a/test/test-indent-mode-destination.org
b/test/test-indent-mode-destination.org
new file mode 100644
index 0000000000..dd13d60261
--- /dev/null
+++ b/test/test-indent-mode-destination.org
@@ -0,0 +1,85 @@
+#+title: Test Destination for org-transclusion-indent-mode
+#+startup: show2levels
+
+* Test Case 1: Short transclusion with following content
+Test that fringes don't extend beyond actual transcluded content.
+
+#+transclude: [[file:test-indent-mode-source.org::*testing - 1][testing - 1]]
+
+- line 1 - should NOT have fringe
+- line 2 - should NOT have fringe
+- line 3 - should NOT have fringe
+- line 4 - should NOT have fringe
+- line 5 - should NOT have fringe
+- line 6 - should NOT have fringe
+- line 7 - should NOT have fringe
+- line 8 - should NOT have fringe
+- line 9 - should NOT have fringe
+- line 10 - should NOT have fringe
+
+* Test Case 2: Full subtree transclusion
+Test fringe placement on complex nested structure.
+
+#+transclude: [[file:test-indent-mode-source.org::*TEST 2 - Complex nested
structure][TEST 2]]
+
+* Test Case 3: Mid-level heading transclusion
+Test transclusion of heading with nested content.
+
+#+transclude: [[file:test-indent-mode-source.org::*HEADING 2.1][HEADING 2.1]]
+
+* Test Case 4: Multiple transclusions in sequence
+Test that multiple transclusions maintain correct fringe boundaries.
+
+#+transclude: [[file:test-indent-mode-source.org::*testing - 1][testing - 1]]
+
+Some text between transclusions.
+
+#+transclude: [[file:test-indent-mode-source.org::*TEST 3 - Single
paragraph][TEST 3]]
+
+More text between transclusions.
+
+#+transclude: [[file:test-indent-mode-source.org::*Table example][Table
example]]
+
+ Test Case 5: Transclusion within list
+Test fringe behavior when transclusion is nested in a list.
+
+- List item 1
+ - Nested item with transclusion below:
+ #+transclude: [[file:test-indent-mode-source.org::*testing - 1][testing -
1]]
+ - Another nested item after transclusion
+
+* Test Case 6: Top-level heading transclusion
+Test transclusion of a top-level heading.
+
+#+transclude: [[file:test-indent-mode-source.org::*Heading test 1 - edit this
to test fringe persistence][Heading test 1]]
+
+* Test Case 7: Special blocks
+Test transclusion of quote blocks and code blocks.
+
+#+transclude: [[file:test-indent-mode-source.org::*Quote block][Quote block]]
+
+* Instructions for Testing
+
+1. Open both files in Emacs with org-indent-mode enabled
+2. Enable org-transclusion-mode in destination buffer
+3. Run M-x org-transclusion-add-all
+
+** Expected Behavior - Graphical Mode
+- Fringe bitmaps appear in left fringe area
+- Fringes only on transcluded content, not following lines
+- Editing source content preserves fringes
+- Editing headings preserves fringes on all child content
+
+** Expected Behavior - Terminal Mode (emacs -nw)
+- ASCII "| " appears at left margin before indentation
+- Fringes only on transcluded content, not following lines
+- Editing source content preserves fringes (may flicker briefly)
+- Longer idle delay (0.7s) reduces flicker during rapid typing
+
+** Common Issues to Verify Fixed
+- [ ] Fringes don't extend beyond transclusion (Test Case 1)
+- [ ] Fringes don't accumulate on repeated edits
+- [ ] Fringes persist when editing list items
+- [ ] Fringes persist when editing headings
+- [ ] Terminal fringes appear at left margin, not after indent
+- [ ] Multiple transclusions maintain separate boundaries (Test Case 4)
diff --git a/test/test-indent-mode-source.org b/test/test-indent-mode-source.org
new file mode 100644
index 0000000000..d8aa477e1d
--- /dev/null
+++ b/test/test-indent-mode-source.org
@@ -0,0 +1,74 @@
+#+title: Test Source for org-transclusion-indent-mode
+
+* TEST 1
+** Heading test 1 - edit this to test fringe persistence
+*** testing - 1
+This is a short transclusion target for testing basic fringe placement.
+Edit this text to verify fringes remain visible during typing.
+
+*** Heading test 2
+- line item - edit this to test fringe on list items
+ - line item 2 - nested list item for testing indentation
+
+* TEST 2 - Complex nested structure
+** HEADING 1
+*** HEADING 2
+- list item 1 in heading 2
+ - list item 2 in heading 2 under list item 1
+ - deeply nested item for testing indentation levels
+
+Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non
+orci commodo lobortis. Proin neque massa, cursus ut, gravida ut,
+lobortis eget, lacus. Sed diam. Praesent fermentum tempor tellus.
+Nullam tempus. Mauris ac felis vel velit tristique imperdiet. Donec at
+pede. Etiam vel neque nec dui dignissim bibendum. Vivamus id enim.
+Phasellus neque orci, porta a, aliquet quis, semper a, massa.
+Phasellus purus. Pellentesque tristique imperdiet tortor. Nam euismod
+tellus id erat.
+
+**** HEADING 2.1
+Proin quam nisl, tincidunt et, mattis eget, convallis nec, purus.
+Edit this paragraph to test fringe behavior on heading content.
+
+***** HEADING 2.1.1
+- Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus.
+- Nunc rutrum turpis sed pede.
+ - Nested item under second list item
+ - Another nested item for testing
+
+**** HEADING 2.2
+Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci
+commodo lobortis. Proin neque massa, cursus ut, gravida ut, lobortis eget,
+lacus. Sed diam. Praesent fermentum tempor tellus. Nullam tempus. Mauris ac
+felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque nec dui
+dignissim bibendum. Vivamus id enim. Phasellus neque orci, porta a, aliquet
+quis, semper a, massa. Phasellus purus. Pellentesque tristique imperdiet
tortor.
+Nam euismod tellus id erat.
+
+* TEST 3 - Single paragraph
+This is a single paragraph target for testing transclusion of simple content.
+Edit this text to verify fringe persistence on paragraph-level transclusions.
+
+* TEST 4 - Table and code
+** Table example
+| Column 1 | Column 2 | Column 3 |
+|----------+----------+----------|
+| Data 1 | Data 2 | Data 3 |
+| Data 4 | Data 5 | Data 6 |
+
+** Code block example
+#+begin_src elisp
+(defun test-function ()
+ "A test function for transclusion."
+ (message "Testing transclusion with code blocks"))
+#+end_src
+
+* TEST 5 - Mixed content with quotes
+** Quote block
+#+begin_quote
+This is a quote block to test transclusion of special blocks.
+Edit this to verify fringe behavior on quoted content.
+#+end_quote
+
+** Regular text after quote
+This paragraph follows the quote block to test mixed content transclusion.