Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit parallel tracking to PrintOrderer #33

Open
andrewjstone opened this issue Aug 2, 2022 · 0 comments
Open

Add explicit parallel tracking to PrintOrderer #33

andrewjstone opened this issue Aug 2, 2022 · 0 comments

Comments

@andrewjstone
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant