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

Test suites shouldn't fiddle with unfolding threshold #113

Open
arybczak opened this issue Mar 10, 2020 · 0 comments
Open

Test suites shouldn't fiddle with unfolding threshold #113

arybczak opened this issue Mar 10, 2020 · 0 comments

Comments

@arybczak
Copy link
Contributor

Since test suites bump unfolding threshold to 150, I find they don't reflect the environment people write code in.

As an example, when I run into the problem from #112 while fiddling with test suite of optics and wanted to include this in the test suite of generic-optics, it turned out that everything inlines just fine within Spec.hs module because of increased unfolding threshold.

If increased threshold is absolutely needed for comparison of the definition of lenses, I suggest going another route: don't compare definitions, compare usage sites of definitions (i.e. don't test core of lenses themselves, test core of applying them to view/set/over etc.

optics has https://github.com/well-typed/optics/blob/0dea927/optics/tests/Optics/Tests/Labels.hs and when I replaced TH optics with generic optics everything passes with #112 and default compiler options, so I consider it a reasonable approach.

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