TLDR
By adding aPrintOrderEntry::ParallelEnd variant to be output from PrintOrderer::print_order, we can drastically simplify our property_indents_are_correct test method.
Details
The PrintOrderer code from #29 only writes when parallel entries start to the ordering output from PrintOrderer::print_order. The ending of parallelism is implicitly specified by the indent level decreasing in a subsequent PrintOrderEntry::Node. This doesn't make printing any harder, as there is no need to print when parallel nodes end. However, not having this information does make the property based testing code more complicated. Instead of ensuring that the indent level in the PrintOrderEntry matches the expected depth of the indent stack, we have to check if the indent level is exactly one less than the number of entries on the stack, which indicates that parallelism has ended. This occurs in multiple match clauses and makes the test harder to read.
TLDR
By adding a
PrintOrderEntry::ParallelEndvariant to be output fromPrintOrderer::print_order, we can drastically simplify ourproperty_indents_are_correcttest method.Details
The
PrintOrderercode from #29 only writes when parallel entries start to the ordering output fromPrintOrderer::print_order. The ending of parallelism is implicitly specified by the indent level decreasing in a subsequentPrintOrderEntry::Node. This doesn't make printing any harder, as there is no need to print when parallel nodes end. However, not having this information does make the property based testing code more complicated. Instead of ensuring that the indent level in thePrintOrderEntrymatches the expected depth of the indent stack, we have to check if the indent level is exactly one less than the number of entries on the stack, which indicates that parallelism has ended. This occurs in multiple match clauses and makes the test harder to read.