Please consider this PR to add a test that checks if two unordered lists are separated properly.
Thanks.
Please consider this PR to add a test that checks if two unordered lists are separated properly.
Thanks.
Welcome back to the Exercism forums!
Thanks for making a suggestion for the Markdown exercise.
Markdown
is a practice exercise that draws its problem description and test data from a common cross-track repository called problem specifications .
The exercise on the Python track is auto-generated from the problem specs repo.
Suggestions for improving the exercise/test data, should be made under problem specifications, so that all tracks can benefit from the discussion and/or change. Any changes made to the Python track directly would be overwritten when the exercise was next synced.
@iHiD ā could we please move this under Exercism
or Building Exercism
so we can have a problem-specs
discussion? Many thanks!
Could you explain why you think this PR is needed and what it accomplishes that isnāt covered by existing tests?
This test is needed because it verifies that the parse
function correctly handles scenarios where two+ unordered lists are separated by other content, such as headings and paragraphs.
Now many solutions pass the tests by substituting:
re.sub(r'(<li>.*</li>)', r'<ul>\1</ul>', text, flags=re.S)
which is correct for one list but wrong if there are more than one lists.
Initial code provided for refactoring correctly solves this test.
Isnāt this correct for multiple lists but incorrect for any list with more than one item?
Are you trying to detect a bug with how multiple lists are handled or to detect a bug with how a single list with multiple items is handled?
This is correct for single list with multiple items. But if more than one list with multiple items are provided then this is incorrect because it treats everything between the start of the first list and the end of the last list as a single list.
The result of applying this logic to my test would be:
End list 1
# Start list 2
End list 2
While the correct answer should be:
End list 1
End list 2
Yes, thatās the case. Currently there is no test with multiple lists so I suggest to include one.
Remember that Markdown
is a refactoring exercise, so there is provided code that passes all current tests. Students are then expected to refactor/clean up the code while keeping all tests green.
Does the existing provided code pass your proposed test? If not, then this becomes a bigger discussion, since adding the test would invalidate all previous solutions. That isnāt forbidden per se, but it does put a higher standard on the test and the reasons for adding it.
It also requires all tracks who accept that test to (maybe) re-write their stub file.
So ā things to considerā¦
Yes, the initial code passes my test.
Created new PR to add this test into canonical-data.json: