Skip to content

Commit

Permalink
support valuetask
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 10, 2020
1 parent 965f106 commit 8f8c497
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/build-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Use an [on_failure build step](https://www.appveyor.com/docs/build-configuration
on_failure:
- ps: Get-ChildItem *.received.* -recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
```
<sup><a href='/src/appveyor.yml#L31-L34' title='File snippet `appveyorartifacts` was extracted from'>snippet source</a> | <a href='#snippet-appveyorartifacts' title='Navigate to start of snippet `appveyorartifacts`'>anchor</a></sup>
<sup><a href='/src/appveyor.yml#L29-L32' title='File snippet `appveyorartifacts` was extracted from'>snippet source</a> | <a href='#snippet-appveyorartifacts' title='Navigate to start of snippet `appveyorartifacts`'>anchor</a></sup>
<!-- endSnippet -->

See also [Pushing artifacts from scripts](https://www.appveyor.com/docs/packaging-artifacts/#pushing-artifacts-from-scripts).
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<NoWarn>CS1591;CS0649;xUnit1026</NoWarn>
<Version>6.12.0</Version>
<Version>6.13.0</Version>
<AssemblyVersion>1.0.0</AssemblyVersion>
<PackageTags>Json, Testing, Verify, Snapshot, Approvals</PackageTags>
<Description>Enables verification of complex models and documents.</Description>
Expand Down
22 changes: 22 additions & 0 deletions src/Verify/Verifier/InnerVerifier_Task.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,27 @@ public async Task Verify<T>(Task<T> task, VerifySettings settings)
}
}
}

public async Task Verify<T>(ValueTask<T> task, VerifySettings settings)
{
Guard.AgainstNull(task, nameof(task));
var target = await task;

try
{
await Verify(target, settings);
}
finally
{
if (target is IAsyncDisposable asyncDisposable)
{
await asyncDisposable.DisposeAsync();
}
else if (target is IDisposable disposable)
{
disposable.Dispose();
}
}
}
}
}
2 changes: 0 additions & 2 deletions src/appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ for:
- sudo mkdir /Users/appveyor/.local/share/NuGet
- sudo chmod a+rwx /Users/appveyor/.local/share/NuGet
build_script:
dotnet --version

dotnet build src --configuration Release

dotnet test src --configuration Release --no-build --no-restore
Expand Down

0 comments on commit 8f8c497

Please sign in to comment.