DUnit Compare Two Text Files and show Diff

2.6k views Asked by At

Is there a way to compare two text files and show the diff if they are not identical in dunit?

The easy start is to read them to TStringList, however the code for comparing two text file is much more complicated, and the gui in the DUnitGui is not sufficient for this.

Any idea? suggestion?

1

There are 1 answers

0
Reallyethical On BEST ANSWER

There is a nice little unit that comes with some examples called TDiff, this is available from http://angusj.com/delphi/ and will allow you to compare 2 files and see the differences, it also allows for merging.

It is a very simple Utility that you can download the entire source for.