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

Added cancellableTaskValidation feature, tests, and documentation #217

Merged

Conversation

1eyewonder
Copy link
Contributor

Proposed Changes

I added support for CancellableTaskValidation with relevant documentation and unit tests. I also fixed/updated some miscellaneous documentation

Types of changes

What types of changes does your code introduce to FsToolkit.ErrorHandling?
Put an x in the boxes that apply and remove ones that don't apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Build and tests pass locally
  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added necessary documentation (if appropriate)

Further comments

As a 'quick-fix' I brought over some of the code which was in the FsToolkit.ErrorHandling.Tests project: Expect.fs, SampleDomain.fs, and TestData.fs for easier unit test implementation (copied and modified from AsyncValidation). I didn't know you wanted to create a shared test library for reduced code or if you wanted to keep things siloed from each other. I am open to either implementation

@TheAngryByrd
Copy link
Collaborator

❤️ This is so awesome.

As a 'quick-fix' I brought over some of the code which was in the FsToolkit.ErrorHandling.Tests project: Expect.fs, SampleDomain.fs, and TestData.fs for easier unit test implementation (copied and modified from AsyncValidation). I didn't know you wanted to create a shared test library for reduced code or if you wanted to keep things siloed from each other. I am open to either implementation

Yeah I've gone back and forth on this. Do whatever you feel is easier at this point. It's not much work to clean up later.

@1eyewonder
Copy link
Contributor Author

I'm fine leaving it for now, and we can always decide later when looking at the job validation since that would technically need similar code

Copy link
Collaborator

@TheAngryByrd TheAngryByrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome start on this. Left some comments:

gitbook/asyncValidation/map3.md Show resolved Hide resolved
gitbook/cancellableTaskResult/index.md Outdated Show resolved Hide resolved


let ``CancellableTaskValidationCE bind Tests`` =
testList "CancellableTaskValidationCE bind Tests" [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start but I think we're also going to need tests for:

  • Task
  • Task<'T>
  • Any awaitable (like Task.Yield()) (this should cover ValueTask/ValueTask<'T> as well)
  • Async
  • All these variants with Result/Validation as well.

Yeah this is gonna hurt.

@TheAngryByrd TheAngryByrd merged commit ceb9009 into demystifyfp:master Jul 7, 2023
TheAngryByrd added a commit that referenced this pull request Jul 7, 2023
- [Added cancellableTaskValidation feature, tests, and documentation](#217) Credits @1eyewonder
@1eyewonder 1eyewonder deleted the feature/cancellableTaskValidation branch July 7, 2023 02:32
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.

2 participants