PRs #4190 <https://github.com/leo-editor/leo-editor/pull/4190> and #4192 
<https://github.com/leo-editor/leo-editor/pull/4192> are now part of devel. 
These PRs are a significant milestone in Leo's history. For the first time, 
a unit test proves that all mode files will execute without raising an 
exception. The unit test found real problems in several mode files. Each PR 
fixed some of those problems.


In retrospect, creating such a unit test was blindingly obvious. But 
considerable preliminary work came first.


The breakthrough came from re-reading PEP #3102 
<https://peps.python.org/pep-3102/>: Keyword-only Arguments. Aha! Python 
will raise a TypeError if a call does not match the function's definition. 
Static checkers like pylint and mypy will not suffice.


After this Aha, the unit test was surprisingly easy to write, as you can 
see for yourself.


Edward


P.S. As noted in the second PR, somebody added defective rules to two mode 
files. Apparently nobody noticed. I certainly don't care :-)


Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/leo-editor/6858bd11-6272-48d4-bb95-bfb03fd0f2ffn%40googlegroups.com.

Reply via email to