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

Alpha-normalize expected results in Prelude tests #1198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

travisbrown
Copy link
Collaborator

This is a follow-up to #1190, where import/success/headerForwardingB.dhall is changed to indicate that import resolution should alpha-normalize when there's an integrity check. When I updated Dhall for Java to fix this test failure, it turned up some new failures in the Prelude tests that need the same change (confirmed by @MonoidMusician here). This PR alpha-normalizes the expected results for these tests so that they're consistent with the import ones.

@travisbrown
Copy link
Collaborator Author

Oh, I also just noticed that type-inference/success/preludeB.dhall would need this same treatment (it's marked as one of my "slow" tests). It looks like that's the only other file that would need changes. I don't have a strong opinion on which way these should go, just that the test results should be consistent about whether alpha-normalization is expected or not.

@Gabriella439
Copy link
Contributor

@travisbrown: Sorry for the delay in reviewing this

My understanding is that the root cause of the test breakage is #1026 where all of the Prelude files were renamed to add a .dhall suffix with the old file names (sans suffix) re-exporting the files with the .dhall suffix. However, this re-exporting behavior changed how they were α-normalized (since the re-export is protected by an integrity check).

I think the most direct way to solve this is to change the test files to import the version without the .dhall suffix so that the result is not α-normalized. Then I believe we don't need to change the expected test result. For example, instead of changing tests/type-inference/success/prelude/Monoid/00B.dhall to be α-normalized, change tests/type-inference/success/prelude/Monoid/00A.dhall to import ../../../../../Prelude/Bool/and.dhall.

The reason I suggest doing it this way is because those test files are intended to correspond roughly to the example code included in the comments of the respective Prelude utilities. For example, all of the Monoid/*.dhall tests correspond to the example code in the documentation for ./Prelude/Monoid.dhall, and those examples are not α-normalized.

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.

None yet

2 participants