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

Improve use of unions in tests #540

Merged
merged 5 commits into from
May 12, 2019

Conversation

philandstuff
Copy link
Collaborator

See commit messages for more details.

this is a byte-for-byte duplicate of unionOfTypesA.dhall in the
same directory
Now that we have empty union alternatives, we don't need to use empty
records as singleton union alternative types in our tests.  Our tests
are also example code, and we should aim to keep them idiomatic as the
language evolves.
We didn't have a unit test for type inference on merging an empty
alternative.
Union literals are deprecated in favour of union constructors.
Therefore, tests should prefer union constructors over union literals
except in cases where union literals cannot be avoided.  This is mainly
in cases where union literals themselves are being tested.

I also changed some filenames to make clear when union literals are
under test.
@philandstuff philandstuff merged commit a39891c into master May 12, 2019
@philandstuff philandstuff deleted the philandstuff/better-unions-in-tests branch May 18, 2019 22:21
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.

3 participants