It seems that one, in my opinion mandatory method is missing from TValue; TValue.Equals(TValue).
So whats a fast and decent way of comparing 2 TValues, preferably without the use of TValue.ToString(), which allows false matches between variants, records, etc.
Delphi-Mocks presents two functions :
With the record helper for TValue you can also do
TValue.Equals(TValue);
Licensed under Apache terms and under permission by Stefan Glienke.
Here is the original source by Stefan : delphisorcery.
If you need to extend the functionality for variants, add:
and insert
after the isString comparison in the
SameValue
function.