Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DUnit Compare Two Text Files and show Diff

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?

like image 838
none Avatar asked Mar 01 '11 10:03

none


1 Answers

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.

like image 61
Reallyethical Avatar answered Sep 22 '22 04:09

Reallyethical