File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 33 <PropertyGroup >
44 <TargetFramework >net8.0</TargetFramework >
55 <GenerateDocumentationFile >true</GenerateDocumentationFile >
6- <Version >0.7.0-beta1 </Version >
6+ <Version >0.7.0-beta2 </Version >
77 <Description >Stateful testing for Hedgehog</Description >
88 <Authors >Alexey Raga</Authors >
99 <Copyright >Copyright © 2025</Copyright >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ type Env = private {
2525/// A symbolic variable is not yet bound to a generated value and is used to represent a value in the model before binding occurs.
2626/// </summary >
2727[<StructuredFormatDisplay( " {DisplayText}" ) >]
28+ [<CustomEquality; CustomComparison>]
2829type Var < 'T > = private {
2930 /// <summary >
3031 /// The unique integer name of the variable.
@@ -127,6 +128,20 @@ Commands that use Var<T> inputs must override Require to call TryResolve and ret
127128 static member internal CreateSymbolic ( value : 'T ) : Var < 'T > =
128129 { Name = - 1 ; Default = Some value; Transform = unbox< 'T>; ResolvedValue = None }
129130
131+ override this.Equals ( other : obj ) : bool =
132+ match other with
133+ | :? Var< 'T> as otherVar -> this.Name = otherVar.Name
134+ | _ -> false
135+
136+ override this.GetHashCode () : int =
137+ hash this.Name
138+
139+ interface System.IComparable with
140+ member this.CompareTo ( other : obj ) : int =
141+ match other with
142+ | :? Var< 'T> as otherVar -> compare this.Name otherVar.Name
143+ | _ -> invalidArg ( nameof other) " Cannot compare values of different types"
144+
130145
131146module internal Env =
132147 /// Empty environment
You can’t perform that action at this time.
0 commit comments