First, to any readers out there, a happy Pi Day to you all. As to how I am doing, I will let everyone know once I finish the rather large apple pie that my partner got me for today. And that is after I walk off that sugar by walking Bruce to the moon and back!
That aside, I have made good strides in moving things forward with the refactoring of the PyMarkdown project and into more tab fixing work. The refactoring was very important for me to get to a certain stage, because I am sure that the planned work on fixing tab support and making sure nested containers work properly will definitely use that code. Call me a pragmatist, but as that work will already be complicated, I want to reduce the effort required for that work where possible.
So, in between starting to clean up the house and doing yardwork here in the Pacific North West, I started to figure out how I wanted to take care of the remaining work for tab support. Whether it is correct or not, I believe that the remaining work can be broken down into two chunks: leaf blocks and container blocks. And while I feel that focusing on nested container blocks is more important, I decided to focus on getting the first pass at the leaf blocks done.
Here is my thinking. I have a decent set of cases specified for Atx Heading blocks and how they interact with tab characters. That is to say, I have good tests that deal with those blocks on their own and those blocks with up to two levels of nested container blocks. While I would prefer to have up to three levels of container blocks, I believe that breadth is currently more important than depth. Continuing on that thought, it followed that getting all the leaf blocks to the same level of coverage as the Atx Heading blocks seemed to be intuitive.
Following that decision, I took a look at the whitespace tests for the Atx Heading blocks and the whitespace tests for the Thematic Break elements, and started marching down the list of what each test covered. For the most part, it was pedantic, but easy.
To be blunt, when I say easy, I mean that coming up with the test cases was easy. As I wanted the container section of both tests to line up with each other, I made sure that the next four to five scenario tests were aligned with each other, one with Thematic Breaks and one with Atx Headings. After that block of tests were updated, I started at the start of the file and compared both files, line by line. Call it being pedantic or call it being paranoid, but I just wanted to make sure that each scenario test lined up in both files.
And it took me a while, but I got there. Before writing this article on Monday, I had an updated set of Atx Heading scenario tests working, with only five tests to get either working of skipped once I finish authoring this article. And that is where I wanted to be. I had no delusions that all Thematic Break tests were going to pass. I know I need to fix them. But using the Atx Heading work as a template, hopefully I can make good progress on that this week.
For me, that is what I mean by scenario tests need focus and quality. It is not enough for me to say that I have scenario tests, but I need to be able to plan out what tests I need to add, and focus on getting them in place. Hopefully most of those tests pass, but I always plan on a handful of the tests failing. So now I can go into next week with some wind at my back, with confidence I am taking the right approach for me and this project. Stay tuned!
So what do you think? Did I miss something? Is any part unclear? Leave your comments below.