emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] org-babel-demarcate-block: split using element API


From: gerard . vermeulen
Subject: Re: [PATCH] org-babel-demarcate-block: split using element API
Date: Sun, 14 Jan 2024 19:18:23 +0000



On 14.01.2024 13:16, Ihor Radchenko wrote:
gerard.vermeulen@posteo.net writes:
[...]
I tried make test and the tests are still failing with this new patch:

1 unexpected results:
   FAILED  test-ob/demarcate-block  ((should (string= region-text
(org-trim (nth 1 info)))) :form (string= "mark this line as region"
"") :value nil :explanation (arrays-of-different-length 24 0 "mark
this line as region" "" first-mismatch-at 0))

This is a tough lesson: the tests pass always on my system.

I think the failure you see is related to a problem marking a region
in my test code (wish: support in `org-test-with-temp-text' for
"<mark>" besides "<point>", but maybe that depends on ERT), else
the problem would have shown up while testing the patch interactively.

I think that I have improved my region marking code by using "<point>"
in the temp-text as a start. Then, I only have to find where to set mark,
and eventually exchange point and mark.

The test code now checks (mark) in the 3 places where a region is marked. This looks superfluous if the code is really robust, but at least it checks
whether the region marking is (or was) the problem.

New patch attached.

Some of the scaffolding (should ...) forms could be removed if
the 5 sub-test in test-ob/demarcate-block would be 5 separated
ERT tests.  I prefer to continue like this and do eventual refactoring
later.

Regards -- Gerard

Attachment: 0001-org-babel-demarcate-block-split-using-element-API.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]