kdheepak / panvimdoc

Write documentation in pandoc markdown. Generate documentation in vimdoc.
https://kdheepak.com/panvimdoc
MIT License
263 stars 15 forks source link

fix: title tests #61

Open backdround opened 1 year ago

backdround commented 1 year ago

I tried to write tests for #60, but figured out that title tests don't work at all because remove_first_line removes the actual title line to test.

I can prove it without manual testing: The occupied space by a month and a day in CURRENT_DATE changes every month (/day), and the count of spaces for padding in the title should change too from time to time. If it worked as expected, it would fail, at least in some short months (June / July).

Here I use Regex to work around this problem.

I didn't sort out how I can add more information "why the test has failed", so I did it by @error

There is how it looks like: image

I hope there is another way to give a fail context

kdheepak commented 1 year ago

Ah, okay don't worry about it! I'll look into this and add a test for it when I get the chance, and update this PR.

I merged your other PR! Thanks for that PR and for adding tests in this PR.