[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: rev 4805 - in trunk: . subversion/tests/libsvn_delta

From: William Uther <willu_at_cse.unsw.edu.au>
Date: 2003-02-11 05:14:19 CET

On Tuesday, February 11, 2003, at 03:04 PM, Greg Stein wrote:

> On Sun, Feb 09, 2003 at 03:45:11PM +0000, Philip Martin wrote:
>> ...
>> I disagree. A "diff" that simply deleted one file and added the
>> second would do that, but it's not very useful. These tests are
>> designed to prohibit that. Obviously in some cases the diff algorithm
>> has to make arbitrary choices, but in the the cases I have tested
>> explicitly I believe the diff output should be predictable. Any
>> variation it is most likely a bug.
>
> Right.
>
> Is it possible to set up a test whereby we have three subdirectories,
> and we
> just start dropping stuff in there?
>
> 1) source
> 2) destination
> 3) expected diff
>
> A test script can then just take triplets at will and run the test. We
> can
> then just start loading the directories, rather than tweaking C code.

That looks good, but that will only be able to test cases where the
diff is unambiguous. Could you make another three directories for
ambiguous diffs:

1) source
2) destination
3) a file containing the maximum diff size.

Again, the script can grab triplets at will. It can run the diff/patch
test; taking the diff between source and dest, re-applying that diff to
source and then comparing with dest. It can also check that the diff
is below the size specified in the third file. This means:

  - We're not checking for identity with the gnu diff algorithm (and
hence limited in terms of implementation), but
  - It doesn't allow degenerate diffs like "remove all", "add all"

The maximum diff sizes could be found by running GNU diff over source
and dest, and then adding 5% slack. If you wanted to get really fancy,
the test could even output the average difference in diff size between
the internal diff and gnu diff.

later,

Will :-}

--
Dr William Uther                            National ICT Australia
Phone: +61 2 9385 6926             School of Computer Science and 
Engineering
Email: willu@cse.unsw.edu.au             University of New South Wales
Jabber: willu@jabber.cse.unsw.edu.au          Sydney, Australia
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Feb 11 05:15:14 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.