Skip to content

Conversation

@maxdeviant
Copy link
Member

This PR adds tests to the project.

Resolves #32.


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@maxdeviant
Copy link
Member Author

I'd also like to add tests for tag, but I couldn't glean how it is intended to be used by looking at the code/docs.

@thomashoneyman
Copy link
Contributor

This is looking good, thank you! I’m on my phone so I will have to come back for a real review tomorrow.

@thomashoneyman
Copy link
Contributor

The tag option lets you take an existing option and fix it to a particular value. For example:

anIntOption :: Option MyOptions Int
anIntOption = opt "anIntOption"

aTaggedInt :: Option MyOptions Unit
aTaggedInt = tag anIntOption 10

Using aTaggedInt will just always set the value of "anIntOption" to 10, and you can only associate with unit (as the argument will be ignored):

aTaggedInt := unit <>
anotherOption ...

I think your existing tests are perfectly adequate, though.

@thomashoneyman thomashoneyman merged commit 5520466 into purescript-contrib:main Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Repository doesn't have tests

2 participants