v6.4b2 "newline-and-indent" unit test failure [patch]

26 views
Skip to first unread message

spike

unread,
Aug 17, 2021, 3:33:18 AM8/17/21
to leo-e...@googlegroups.com
patch 73eaf41fff7c150012448f8113ca45623bb5aa23
"Use textwrap.dedent instead of g.adjustTripleString everywhere"
in v6.4b2 breaks "newline-and-indent" unit test.

The problem is that textwrap.dedent clears empty lines and the test
needs to insert an indented blank line in order to work. Attached patch
fixes the problem by disabling textwrap.dedent for the affected test.


Error messages:
Test case for newline-and-indent ... mismatch in body
expected:
[
'first line\n',
'line 1\n',
'\n',
' line a\n',
' line b\n',
'line c\n',
'last line\n'
]
got:
[
'first line\n',
'line 1\n',
' \n',
' line a\n',
' line b\n',
'line c\n',
'last line\n'
]
parent_p.b ''
FAIL

Traceback (most recent call last):
File "leo/unittests/commands/test_editCommands.py", line 2498, in
test_newline_and_indent
self.run_test(
File "leo/unittests/commands/test_editCommands.py", line 53, in run_test
assert False
AssertionError

newline-and-indent.patch

Edward K. Ream

unread,
Aug 17, 2021, 3:42:36 AM8/17/21
to leo-editor
On Tue, Aug 17, 2021 at 2:33 AM spike <spiketheh...@runbox.com> wrote:
patch 73eaf41fff7c150012448f8113ca45623bb5aa23
    "Use textwrap.dedent instead of g.adjustTripleString everywhere"
    in v6.4b2 breaks "newline-and-indent" unit test.

Thanks for this. The root of the problem is that my testing protocol does not automatically run the tests in test_edit_commands.py and other similar files.

Edward

Edward K. Ream

unread,
Aug 17, 2021, 10:15:38 AM8/17/21
to leo-editor
On Tuesday, August 17, 2021 at 2:42:36 AM UTC-5 Edward K. Ream wrote:

> The root of the problem is that my testing protocol does not automatically run the tests in test_edit_commands.py and other similar files.

And there are other problems. The patch is necessary, but not sufficient.  See #2138 for the messy details.

Edward
Reply all
Reply to author
Forward
0 new messages