File tree Expand file tree Collapse file tree 3 files changed +24
-7
lines changed
Expand file tree Collapse file tree 3 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 11## Version 0.12.0
22
33- Add Property.failOnFalse ([ #380 ] [ 380 ] , [ @TysonMN ] [ TysonMN ] )
4+ - Fix bug [ #381 ] [ 381 ] that prevents rendering of reports containing ` None ` ([ #382 ] [ 382 ] , [ @TysonMN ] [ TysonMN ] )
45
56## Version 0.11.0 (2021-09-22)
67
175176[ porges] :
176177 https://github.com/porges
177178
179+ [ 382] :
180+ https://github.com/hedgehogqa/fsharp-hedgehog/pull/382
181+ [ 381] :
182+ https://github.com/hedgehogqa/fsharp-hedgehog/pull/381
178183[ 380] :
179184 https://github.com/hedgehogqa/fsharp-hedgehog/pull/380
180185[ 363] :
Original file line number Diff line number Diff line change @@ -109,13 +109,16 @@ module Property =
109109 #if FABLE_ COMPILER
110110 value
111111 #else
112- let t = value.GetType()
113- // have to use TypeInfo due to targeting netstandard 1.6
114- let t = System.Reflection.IntrospectionExtensions.GetTypeInfo( t)
115- let isList = t.IsGenericType && t.GetGenericTypeDefinition() = typedefof< ResizeArray<_>>
116- if isList
117- then value :?> System.Collections.IEnumerable |> Seq.cast< obj> |> List.ofSeq :> obj
118- else value
112+ if value = null then
113+ value
114+ else
115+ let t = value.GetType()
116+ // have to use TypeInfo due to targeting netstandard 1.6
117+ let t = System.Reflection.IntrospectionExtensions.GetTypeInfo( t)
118+ let isList = t.IsGenericType && t.GetGenericTypeDefinition() = typedefof< ResizeArray<_>>
119+ if isList
120+ then value :?> System.Collections.IEnumerable |> Seq.cast< obj> |> List.ofSeq :> obj
121+ else value
119122 #endif
120123
121124 value |> prepareForPrinting |> sprintf " %A "
Original file line number Diff line number Diff line change @@ -51,4 +51,13 @@ let propertyTests = testList "Property tests" [
5151#else
5252 Expect.stringContains report guid " Missing counterexample text"
5353#endif
54+
55+ testCase " Report containing None renders without throwing an exception" <| fun () ->
56+ property {
57+ let! opt = Gen.constant () |> Gen.option
58+ return opt.IsSome
59+ }
60+ |> Property.report
61+ |> Report.render
62+ |> ignore
5463]
You can’t perform that action at this time.
0 commit comments