How to add unit test to an existing exercise?

Hello, i am new to this platform and I just complete the markdown exercise in python, but i figured out the fact that one case is not tested, that’s why I want to make a PR on github, but i don’t really understand what i am supposed to do ^^'.
If I am right, I should just add and new field in this json ?
problem-specifications/exercises/markdown/canonical-data.json at main · exercism/problem-specifications · GitHub, according to problem-specifications/README.md at main · exercism/problem-specifications · GitHub
Thanks :slight_smile:

You found the right place for that. We would like to discuss your new test case in the forum before starting a Pull Request.

Please provide:

  • What input and expected output do you want to add?
  • Why do you think this is missing from the existent tests?
  • Do you think, that adding this test case will invalidate existing solutions? And for what reason will they fail?

What ?

I was expecting something like that, a double list check.

self.assertEqual(
    parse("# Start a list\n* __Bold item 1__\n# Start a new list\n* _New italic item 1_"),
    "<h1>Start a list</h1><ul><li><strong>Bold item 1</strong></li></ul>"+
    "<h1>Start a new list</h1><ul><li><em>New italic item 1</em></li></ul>",
)

Why ?

The original code passes the test, but I’ve seen some code that doesn’t validate it, and as far as I know, a refactor is not suposed to modify the original code.

Does it invalidater other’s solution ?

I’ve seen code that only uses the regex to encapsulate the first and last <li> tags, but there are no checks that all the lines are part of the list.

exemples :

I hope my message is understandable :sweat_smile:

Is that valid markdown syntax?

@IsaacG
I don’t understand your question :sweat_smile:
Why are you thinking it is not a valid syntax ?
This a visual representation of what it should look like

Start a list

  • Bold item 1

Start a new list

  • New italic item 1

Edit: Oh Im being silly, the \n is not being parsed properly

Start a list

  • Bold item 1

Start a new list

  • New italic item 1

I misread the markdown with the newlines :slight_smile: It looks valid to me.

OK, so the major difference to f0bbbbde-0f52-4c0c-99ec-be4c60126dd4 (‘unordered lists close properly with preceding and following lines’) is, that it uses a second unordered list as the ‘lines following the list’.

The question now to everybody is: Do we want to have this additional test case added to the exercise, making it a bit harder to solve? Do we want to replace the existing test with this one? Or do we see this test case as unnecessary complication of the exercise?

1/ I mean, refactoring a program is not supposed to modify the execution, so yes, I think it is necessary. I have seen many people who pass this test, and some who can’t pass it
2 and 3/ I think both are compatible, because it don’t test the same case

What do you think ?