VSoftTechnologies / DUnitX

Delphi Unit Test Framework
Apache License 2.0
383 stars 200 forks source link

Improve Assert.NoDiff #328

Closed luebbe closed 1 year ago

luebbe commented 1 year ago

It always bothered me that Assert.NoDiff didn't even attempt to compare when the length of the strings wasn't equal. Did nobody ever have the case that A is a substring of B or that strings have different lengths but are identical up to a certain position? Now Assert.NoDiff always compares. If no differences are found and the lengths aren't equal, the remainder is reported as difference.

While working on this, I added Trim() to the FailFmt function in order to get rid of the unnecessary trailing spaces, when no message is passed into the Assert. AFAICT this is not a breaking change for anybody else.

vincentparrett commented 1 year ago

Thanks, looks good.