On Thu, Aug 19, 2010 at 11:53 PM, Sam Hartsfield <[email protected]> wrote:

> If I try to make unit tests for these [headline] cases: for
> body text you have the helper "runEditCommandTest". Is there something
> similar I'm missing for testing edit commands in headlines, or would I
> need to write out some more extensive code? If so, should I bother in
> this case?

I always recommend unit tests.  Especially for headlines, which are
the most fragile part of Leo.

I doubt if there are any helpers.  The place to look is in leoTest.py.
 The new recommended pattern is to define common helpers in a node
near the unit test in unitTest.leo, and then to use::

    exec(g.findTestScript(c,<headline name>)

to "import" the common code into your unit test.

> One more issue: backward-delete-word doesn't work with the Tk GUI;
> apparently w.delete() doesn't like it when from_pos > to_pos; it just
> doesn't delete anything. Is this something that should be fixed in the
> Tk plugin, to make it consistent with Qt, or should I just flip them
> when necessary before I call w.delete()?

The easiest way would be to flip them as needed, so as not to impact any gui.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to