Skip to content

Test-suite coverage for type-class laws of core types #785

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

recursion-ninja
Copy link
Collaborator

@recursion-ninja recursion-ninja commented Jul 14, 2025

This PR adds QuickCheck-based property tests for the type-class laws of all data-types exported from the Database.LSMtree module. This PR is motivated by the code coverage discussion from #662. Many of the data-types have non-trivial instances of type-classes and it is prudent to provide assurance that the data-types have lawful instance.

Note: Exception data-types were excluded from coverage as they tend to only have a Show instance.

Here is the coverage improvement of the most impacted modules.

Added Old New Module
47 47% 82% Database.LSMTree
29 40% 70% Database.LSMTree.Internal.Config
4 35% 37% Database.LSMTree.Internal.Paths
3 37% 75% Database.LSMTree.Internal.Range
7 20% 23% Database.LSMTree.Internal.Snapshot
15 48% 54% Database.LSMTree.Internal.Unsafe
More modules
110 42% 45% Total

@recursion-ninja recursion-ninja force-pushed the recursion-ninja/code-coverage-type-class-laws branch from 11dba78 to 3c71853 Compare July 14, 2025 14:33
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

Successfully merging this pull request may close these issues.

1 participant