The new sentinels code has past its first major milestone. The
following round-trip test passes:
- Set new_write to True in the working copy of leoPy.leo.
- Start a test copy of LeoPy.leo. Write leoAtFile.py, thereby
generating new sentinels.
- Restart the test copy of LeoPy.leo. Writing leoAtFile.py leaves
the file unchanged.
This is just the start of rigorous testing. At least two problems
remain:
1. In some cases, not yet fully understood, clones can caused body
text to be duplicated. Amusingly, this does not cause apparent harm:
some nodes become something like:
def foo():
body
def foo():
body
Python is fine with the duplication, though pylint would complain :-)
2. Text following section references, like:
if ( <<condition>> ):
becomes, after round-tripping:
if ( << condition >>
):
BTW, the parens are required, because the expansion of << condition >>
will take several lines. I forget how this case was handled with old
sentinels--something similar will be needed with new sentinels.
Edward
P.S. The works has had quite an ad-hoc flavor to it. It's not
entirely clear how to put it on a more sold basis. Unit tests might
help, but it's a bit hard to see how to make them easy enough to
create to be really useful. More thought is needed on this topic.
Perhaps a more useful approach would be to automate round-trip
testing. This would involve a script that creates and compares the
first and second generations of leoPy.leo and all of Leo's core files.
EKR
--
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.