You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,19 +213,25 @@ let ``"i" mostly ranges between -1 and 1`` i =
213
213
This optional attribute can decorate modules or classes. It sets default arguments for [`AutoGenConfig`, `AutoGenConfigArgs`](#-autogenconfig-and-autogenconfigargs), [`Tests`](#-tests), [`Shrinks`](#-shrinks), and [`Size`](#-size). These will be overridden by any explicit arguments on `[<Property>]`.
214
214
215
215
```f#
216
-
type Int13 = static member __ = GenX.defaults |> AutoGenConfig.addGenerator (Gen.constant 13)
217
-
type Int2718 = static member __ = GenX.defaults |> AutoGenConfig.addGenerator (Gen.constant 2718)
218
-
219
-
[<Properties(typeof<Int13>, 1<tests>)>]
220
-
module ``Module with <Properties> tests`` =
221
-
222
-
[<Property>]
223
-
let ``this passes and runs once`` (i: int) =
224
-
i = 13
225
-
226
-
[<Property(typeof<Int2718>, 2<tests>)>]
227
-
let ``this passes and runs twice`` (i: int) =
228
-
i = 2718
216
+
type Int13A = static member __ = GenX.defaults |> AutoGenConfig.addGenerator (Gen.constant 13 ) |> AutoGenConfig.addGenerator (Gen.constant "A")
217
+
type Int2718 = static member __ = GenX.defaults |> AutoGenConfig.addGenerator (Gen.constant 2718)
218
+
type Int2718Minimal = static member __ = AutoGenConfig.defaults |> AutoGenConfig.addGenerator (Gen.constant 2718)
219
+
220
+
[<Properties(typeof<Int13A>, 1<tests>)>]
221
+
module ``Module with <Properties> tests`` =
222
+
223
+
[<Property>]
224
+
let ``this passes and runs once`` (i: int) =
225
+
i = 13
226
+
227
+
[<Property(typeof<Int2718>, 2<tests>)>]
228
+
let ``this passes and runs twice`` (i: int) =
229
+
i = 2718
230
+
231
+
[<Property(typeof<Int2718Minimal>)>]
232
+
let ``the `Int13A` and `Int2718Minimal` configs are merged, so this passes`` (i: int, s: string) =
233
+
// `<Property>` uses the "minimal" `AutoGenConfig.defaults`. Using `GenX.defaults` would override the `A` in `Int13A`.
0 commit comments