@@ -323,15 +323,15 @@ let ``auto with recursive option members does not cause stack overflow using def
323323let ``auto with recursive option members respects max recursion depth`` () =
324324 Property.check <| property {
325325 let! depth = Gen.int32 <| Range.exponential 0 5
326- let! x = GenX.autoWith< RecOption> { GenX.defaults with RecursionDepth = depth}
326+ let! x = GenX.autoWith< RecOption> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth)
327327 x.Depth <=! depth
328328 }
329329
330330[<Fact>]
331331let ``auto with recursive option members generates some values with max recursion depth`` () =
332332 checkWith 10 < tests> <| property {
333333 let! depth = Gen.int32 <| Range.linear 1 5
334- let! xs = GenX.autoWith< RecOption> { GenX.defaults with RecursionDepth = depth}
334+ let! xs = GenX.autoWith< RecOption> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth)
335335 |> ( Gen.list ( Range.singleton 100 ))
336336 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
337337 }
@@ -355,15 +355,15 @@ let ``auto with recursive array members does not cause stack overflow using defa
355355let ``auto with recursive array members respects max recursion depth`` () =
356356 Property.check <| property {
357357 let! depth = Gen.int32 <| Range.exponential 0 5
358- let! x = GenX.autoWith< RecArray> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
358+ let! x = GenX.autoWith< RecArray> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
359359 x.Depth <=! depth
360360 }
361361
362362[<Fact>]
363363let ``auto with recursive array members generates some values with max recursion depth`` () =
364364 checkWith 10 < tests> <| property {
365365 let! depth = Gen.int32 <| Range.linear 1 5
366- let! xs = GenX.autoWith< RecArray> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
366+ let! xs = GenX.autoWith< RecArray> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
367367 |> ( Gen.list ( Range.singleton 100 ))
368368 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
369369 }
@@ -387,15 +387,15 @@ let ``auto with recursive list members does not cause stack overflow using defau
387387let ``auto with recursive list members respects max recursion depth`` () =
388388 Property.check <| property {
389389 let! depth = Gen.int32 <| Range.exponential 0 5
390- let! x = GenX.autoWith< RecList> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
390+ let! x = GenX.autoWith< RecList> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
391391 x.Depth <=! depth
392392 }
393393
394394[<Fact>]
395395let ``auto with recursive list members generates some values with max recursion depth`` () =
396396 checkWith 10 < tests> <| property {
397397 let! depth = Gen.int32 <| Range.linear 1 5
398- let! xs = GenX.autoWith< RecList> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
398+ let! xs = GenX.autoWith< RecList> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
399399 |> ( Gen.list ( Range.singleton 100 ))
400400 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
401401 }
@@ -419,15 +419,15 @@ let ``auto with recursive ResizeArray members does not cause stack overflow usin
419419let ``auto with recursive ResizeArray members respects max recursion depth`` () =
420420 Property.check <| property {
421421 let! depth = Gen.int32 <| Range.exponential 0 5
422- let! x = GenX.autoWith< RecResizeArray> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
422+ let! x = GenX.autoWith< RecResizeArray> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
423423 x.Depth <=! depth
424424 }
425425
426426[<Fact>]
427427let ``auto with recursive ResizeArray members generates some values with max recursion depth`` () =
428428 checkWith 10 < tests> <| property {
429429 let! depth = Gen.int32 <| Range.linear 1 5
430- let! xs = GenX.autoWith< RecResizeArray> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
430+ let! xs = GenX.autoWith< RecResizeArray> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
431431 |> ( Gen.list ( Range.singleton 100 ))
432432 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
433433 }
@@ -451,15 +451,15 @@ let ``auto with recursive Dictionary members does not cause stack overflow using
451451let ``auto with recursive Dictionary members respects max recursion depth`` () =
452452 Property.check <| property {
453453 let! depth = Gen.int32 <| Range.exponential 0 5
454- let! x = GenX.autoWith< RecDictionary> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
454+ let! x = GenX.autoWith< RecDictionary> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
455455 x.Depth <=! depth
456456 }
457457
458458[<Fact>]
459459let ``auto with recursive Dictionary members generates some values with max recursion depth`` () =
460460 checkWith 10 < tests> <| property {
461461 let! depth = Gen.int32 <| Range.linear 1 5
462- let! xs = GenX.autoWith< RecDictionary> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
462+ let! xs = GenX.autoWith< RecDictionary> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
463463 |> ( Gen.list ( Range.singleton 100 ))
464464 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
465465 }
@@ -483,15 +483,15 @@ let ``auto with recursive set members does not cause stack overflow using defaul
483483let ``auto with recursive set members respects max recursion depth`` () =
484484 Property.check <| property {
485485 let! depth = Gen.int32 <| Range.exponential 0 5
486- let! x = GenX.autoWith< RecSet> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
486+ let! x = GenX.autoWith< RecSet> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
487487 x.Depth <=! depth
488488 }
489489
490490[<Fact>]
491491let ``auto with recursive set members generates some values with max recursion depth`` () =
492492 checkWith 10 < tests> <| property {
493493 let! depth = Gen.int32 <| Range.linear 1 5
494- let! xs = GenX.autoWith< RecSet> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
494+ let! xs = GenX.autoWith< RecSet> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
495495 |> ( Gen.list ( Range.singleton 100 ))
496496 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
497497 }
@@ -515,15 +515,15 @@ let ``auto with recursive map members does not cause stack overflow using defaul
515515let ``auto with recursive map members respects max recursion depth`` () =
516516 Property.check <| property {
517517 let! depth = Gen.int32 <| Range.exponential 0 5
518- let! x = GenX.autoWith< RecMap> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
518+ let! x = GenX.autoWith< RecMap> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
519519 x.Depth <=! depth
520520 }
521521
522522[<Fact>]
523523let ``auto with recursive map members generates some values with max recursion depth`` () =
524524 checkWith 10 < tests> <| property {
525525 let! depth = Gen.int32 <| Range.linear 1 5
526- let! xs = GenX.autoWith< RecMap> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
526+ let! xs = GenX.autoWith< RecMap> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
527527 |> ( Gen.list ( Range.singleton 100 ))
528528 test <@ xs |> List.exists ( fun x -> x.Depth = depth) @>
529529 }
@@ -563,8 +563,8 @@ let ``auto with mutually recursive types does not cause stack overflow using def
563563let ``auto with mutually recursive types respects max recursion depth`` () =
564564 Property.check <| property {
565565 let! depth = Gen.int32 <| Range.exponential 0 5
566- let! x1 = GenX.autoWith< MutuallyRecursive1> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
567- let! x2 = GenX.autoWith< MutuallyRecursive2> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 0 5 }
566+ let! x1 = GenX.autoWith< MutuallyRecursive1> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
567+ let! x2 = GenX.autoWith< MutuallyRecursive2> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 0 5 ))
568568 x1.Depth <=! depth
569569 x2.Depth <=! depth
570570 }
@@ -573,9 +573,9 @@ let ``auto with mutually recursive types respects max recursion depth`` () =
573573let ``auto with mutually recursive types generates some values with max recursion depth`` () =
574574 checkWith 10 < tests> <| property {
575575 let! depth = Gen.int32 <| Range.linear 1 5
576- let! xs1 = GenX.autoWith< MutuallyRecursive1> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
576+ let! xs1 = GenX.autoWith< MutuallyRecursive1> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
577577 |> ( Gen.list ( Range.singleton 100 ))
578- let! xs2 = GenX.autoWith< MutuallyRecursive2> { GenX.defaults with RecursionDepth = depth; SeqRange = Range.exponential 1 5 }
578+ let! xs2 = GenX.autoWith< MutuallyRecursive2> ( GenX.defaults |> AutoGenConfig.setRecursionDepth depth |> AutoGenConfig.setSeqRange ( Range.exponential 1 5 ))
579579 |> ( Gen.list ( Range.singleton 100 ))
580580 test <@ xs1 |> List.exists ( fun x -> x.Depth = depth) @>
581581 test <@ xs2 |> List.exists ( fun x -> x.Depth = depth) @>
@@ -877,7 +877,8 @@ module ShrinkTests =
877877 let ``one - dimentional array shrinks correctly when empty disallowed`` () =
878878 let property = property {
879879 let! array =
880- { GenX.defaults with SeqRange = Range.constant 2 5 }
880+ GenX.defaults
881+ |> AutoGenConfig.setSeqRange ( Range.constant 2 5 )
881882 |> GenX.autoWith< int []>
882883 test <@ 1 <> array.[ 0 ] @>
883884 }
@@ -897,7 +898,8 @@ module ShrinkTests =
897898 let ``two - dimentional array shrinks correctly when empty disallowed`` () =
898899 let property = property {
899900 let! array =
900- { GenX.defaults with SeqRange = Range.constant 1 5 }
901+ GenX.defaults
902+ |> AutoGenConfig.setSeqRange ( Range.constant 1 5 )
901903 |> GenX.autoWith< int [,]>
902904 test <@ 1 <> array.[ 0 , 0 ] @>
903905 }
@@ -910,7 +912,8 @@ module ShrinkTests =
910912 let ``auto of ResizeArray shrinks correctly`` () =
911913 let property = property {
912914 let! resizeArray =
913- { GenX.defaults with SeqRange = Range.constant 4 4 }
915+ GenX.defaults
916+ |> AutoGenConfig.setSeqRange ( Range.constant 4 4 )
914917 |> GenX.autoWith< ResizeArray< int>>
915918 test <@ 1 <> resizeArray.[ 0 ] @>
916919 }
@@ -988,7 +991,8 @@ let ``auto can generate record with Nullable fields`` () =
988991let ``auto can generate Nullable bool without recursion`` () =
989992 Property.check <| property {
990993 let! _ =
991- { GenX.defaults with RecursionDepth = 0 }
994+ GenX.defaults
995+ |> AutoGenConfig.setRecursionDepth 0
992996 |> GenX.autoWith< Nullable< bool>>
993997 ()
994998 }
@@ -998,7 +1002,8 @@ let ``auto can generate seq`` () =
9981002 Property.checkBool <| property {
9991003 let! expectedLen = Gen.int32 ( Range.linear 0 105 )
10001004 let! xs =
1001- { GenX.defaults with SeqRange = Range.singleton expectedLen }
1005+ GenX.defaults
1006+ |> AutoGenConfig.setSeqRange ( Range.singleton expectedLen)
10021007 |> GenX.autoWith< seq< int>>
10031008
10041009 return Seq.length xs = expectedLen
@@ -1030,15 +1035,15 @@ type Poodle() =
10301035
10311036[<Fact>]
10321037let ``Type Dog is Shape_CliMutable`` () =
1033- let isDogCliMutable =
1038+ let isDogCliMutable =
10341039 match TypeShape.Create< Dog> () with
10351040 | Shape.CliMutable _ -> true
10361041 | _ -> false
10371042 test <@ isDogCliMutable @>
10381043
10391044[<Fact>]
10401045let ``Type Poodle is Shape_CliMutable`` () =
1041- let isPoodleCliMutable =
1046+ let isPoodleCliMutable =
10421047 match TypeShape.Create< Poodle> () with
10431048 | Shape.CliMutable _ -> true
10441049 | _ -> false
0 commit comments