Skip to content

Commit

Permalink
Update to Hedgehog.Experimental v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmaturtle committed Feb 7, 2021
1 parent 0429451 commit eccad94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Hedgehog.Xunit/Hedgehog.Xunit.fsproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<IsPackable>true</IsPackable>
Expand Down Expand Up @@ -27,7 +27,7 @@ Docs at https://github.com/dharmaturtle/fsharp-hedgehog-xunit
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Hedgehog.Experimental" Version="0.3.0" />
<PackageReference Include="Hedgehog.Experimental" Version="0.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
</ItemGroup>
Expand Down
5 changes: 4 additions & 1 deletion src/Hedgehog.Xunit/InternalLogic.fs
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@ let report (testMethod:MethodInfo) testClass testClassInstance =
|> toProperty
finally
List.iter dispose args
Property.forAll gens invoke |> Property.report' tests
let config =
PropertyConfig.defaultConfig
|> PropertyConfig.withTests tests
Property.forAll invoke gens |> Property.reportWith config
6 changes: 3 additions & 3 deletions tests/Hedgehog.Xunit.Tests/PropertyTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module ``Property module tests`` =
let report = InternalLogic.report (getMethod methodName) typeof<Marker>.DeclaringType null
match report.Status with
| Status.Failed r ->
Assert.Equal(expected, Journal.toList r.Journal |> Seq.head)
Assert.Equal(expected, r.Journal |> Journal.eval |> Seq.head)
| _ -> failwith "impossible"

[<Property(Skip = skipReason)>]
Expand Down Expand Up @@ -50,7 +50,7 @@ module ``Property module tests`` =
let report = InternalLogic.report (nameof ``Result with Error reports exception with Error value, skipped`` |> getMethod) typeof<Marker>.DeclaringType null
match report.Status with
| Status.Failed r ->
let errorMessage = r.Journal |> Journal.toList |> Seq.skip 1 |> Seq.exactlyOne
let errorMessage = r.Journal |> Journal.eval |> Seq.skip 1 |> Seq.exactlyOne
Assert.Contains("System.Exception: Result is in the Error case with the following value:\r\n\"Too many digits!\"", errorMessage)
| _ -> failwith "impossible"

Expand Down Expand Up @@ -321,7 +321,7 @@ module ``Asynchronous tests`` =
let report = InternalLogic.report (getMethod methodName) typeof<Marker>.DeclaringType null
match report.Status with
| Status.Failed r ->
Assert.Equal(expected, Journal.toList r.Journal |> Seq.head)
Assert.Equal(expected, r.Journal |> Journal.eval |> Seq.head)
| _ -> failwith "impossible"

open System.Threading.Tasks
Expand Down

0 comments on commit eccad94

Please sign in to comment.