Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert.AreEqual<T> needs to become smarter of picking a comparer #167

Open
jpluimers opened this issue Nov 1, 2016 · 1 comment
Open

Comments

@jpluimers
Copy link
Contributor

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.

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.

It would be nice (but a lot of work) to do something similar for DUnitX on the comparison level.

@vincentparrett
Copy link
Member

Happy to accept a PR for this, I don't have the time to implement it myself right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants