Open jpluimers opened 7 years ago
Right now Assert.AreEqual<T> takes the easy way out (probably the Delphi RTL takes the easy way out as well) by using TComparer<T>.Default.
Assert.AreEqual<T>
TComparer<T>.Default
This happens for any dynamic array (I'm working for a fix on that) or any record type having reference fields in it for instance on this:
TRecordWithReferences = record Value: Integer; Reference: string; end;
The intrinsic Copy in the System unit is smarter and ends up in methods like _CopyArray and __CopyRecord to do the actual deep copy.
Copy
System
_CopyArray
__CopyRecord
It would be nice (but a lot of work) to do something similar for DUnitX on the comparison level.
Happy to accept a PR for this, I don't have the time to implement it myself right now.
Right now
Assert.AreEqual<T>
takes the easy way out (probably the Delphi RTL takes the easy way out as well) by usingTComparer<T>.Default
.This happens for any dynamic array (I'm working for a fix on that) or any record type having reference fields in it for instance on this:
The intrinsic
Copy
in theSystem
unit is smarter and ends up in methods like_CopyArray
and__CopyRecord
to do the actual deep copy.It would be nice (but a lot of work) to do something similar for DUnitX on the comparison level.