Skip to content

[repo-assist] tests: add coverage for ValueTask helper module - #484

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/improve-valuetask-test-coverage-0f09fa068ede7daa
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
repo-assist/improve-valuetask-test-coverage-0f09fa068ede7daa

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

🤖 This PR was created by Repo Assist, an automated AI assistant.

What

Adds direct unit test coverage for the FSharp.Control.ValueTask helper module in Utils.fs: fromResult, ofSource, ofTask, ignore, the True/False constants, ValueTask.CompletedTask, and the deprecated aliases FromResult/ofIValueTaskSource.

Why

While investigating other work, I noticed Utils.Tests.fs has solid coverage for the Task and Async helper modules (bind, map, exception propagation, etc.) but zero direct tests for the parallel ValueTask module, even though it's used pervasively throughout the library and test suite (e.g. ValueTask.ofTask, ValueTask.True/False appear in TestUtils.fs and several test files, but only as incidental usage, not as targeted assertions on the helper functions themselves).

New tests cover:

  • ValueTask.CompletedTask — already-completed marker value
  • ValueTask.True / ValueTask.False — completed boolean constants
  • ValueTask.fromResult and its deprecated alias FromResult
  • ValueTask.ofTask — both already-completed and pending source Task<'T>
  • ValueTask.ignore — discarding results from both completed and pending ValueTask<'T>, including exception propagation through the ignored ValueTask
  • ValueTask.ofSource and its deprecated alias ofIValueTaskSource — using a minimal IValueTaskSource<bool> test double built on ManualResetValueTaskSourceCore<bool>

No production code was changed; this is a test-only addition.

Test Status

Passed!  - Failed: 0, Passed: 5446, Skipped: 2, Total: 5448, Duration: 1m38s (full suite, Release)
  • dotnet build -c Release: succeeds, 0 warnings, 0 errors
  • dotnet fantomas . --check: passes (file reformatted with dotnet fantomas before commit)
  • New tests alone: 22 passed, 0 failed

AI disclosure

This PR was created by Repo Assist, an automated AI assistant, as part of routine test-coverage improvement (Task 5: Coding Improvements). A human maintainer should review before merging.

Generated by 🌈 Repo Assist, see workflow run. Learn more.
Comment /repo-assist to run again

Add this agentic workflow to your repo

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@4bc8419fad05e6b032741cbfd189986700bcf71c

Adds direct unit tests for FSharp.Control.ValueTask functions
(fromResult, ofSource, ofTask, ignore, True/False constants) and
their deprecated aliases (FromResult, ofIValueTaskSource). These
functions previously had no dedicated test coverage, unlike their
Task/Async counterparts already exercised in Utils.Tests.fs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants