Conversation
|
I see that the indentation is wrong for transclusions without a Here is a simple test case where the indentation is wrong, too. File def foo():
print("foo")File Another issue that you might hit when running |
|
Since the indentation inside a src-block is correct, the question is: Do we need to support code transclusion without a src-block at all? |
|
Regarding unit-tests: What kind of unit-tests do you have in mind? Some time ago I started with an ERT testsuite. It's not a strict unit testing, but a top-level white-box testing that does comparisions with detached files, similar to the noweb test file. This testsuite displays diff buffers for all tests that failed, and it can check simple live-editing as well. If you are interested I can provide the code. But I need to refactor the code first. |
|
Was just about to post an issue for this, I was fixing #304 related to Regarding more tests, I've added several thing-at-point org tests here: I noticed after fixing 'defun' thing-at-point, even if the match to the defun was succesful, the transcluded region began at the exact position of the match instead of ht beginning of the line/indentation like it used to.
In this org test file I went over:
I think I could make most of these into ert tests without much trouble since I've delineated expected results from multiple types of transclusions for all thing-at-point transclusions I could think of, we could add them to any other ert test suite for src-lines.el, since my tests focus mainly on thing-at-point. I have also have several tests for org-transclusion-blocks.el which could be ported over to org-transclusion.el as ert tests, for :lines and :src, also have some for text properties and fringe creation. |
|
@gggion: Looks good to me. While looking into this, I noticed a few things that are not related to this fix, but are somehow related to this topic. Here's an example: File (defun foo ()
(message "aaa") ;; This is important [id-123]
(message "bbb"))
(message "this is not part of foo()")File |


fix #295
We really should have unit-test.
@AndreasMatthias , I'd appreciate it if you ran your unit-test.el for no-web. On my end, I don't think I am running it correctly but it looks like the test fails.