xdiff : remove not needed code

xdiff : update tests to add Exception tests


git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4313 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2018-07-30 13:55:52 +00:00
parent a5efc67431
commit 1c98af7f14
2 changed files with 46 additions and 28 deletions

View File

@@ -196,13 +196,6 @@ class xdiff
if (empty ($chunk1) && ! empty ($chunk2))
{
// APPEND
while ($j < count ($array2))
{
if ($array2[$j] === $lcs)
break;
$chunk2[] = $array2[$j];
$j++;
}
$diff[] = array ("type" => "Append",
"startLine1" => $i,
"endLine1" => $i,
@@ -214,13 +207,6 @@ class xdiff
elseif (! empty ($chunk1) && empty ($chunk2))
{
// DELETE
while ($i < count ($array1))
{
if ($array1[$i] === $lcs)
break;
$chunk1[] = $array1[$i];
$i++;
}
$diff[] = array ("type" => "Delete",
"startLine1" => 1 + $i - count ($chunk1),
"endLine1" => $i,
@@ -232,20 +218,6 @@ class xdiff
else
{
// CHANGE ON BOTH ARRAY
while ($i < count ($array1))
{
if ($array1[$i] === $lcs)
break;
$chunk1[] = $array1[$i];
$i++;
}
while ($j < count ($array2))
{
if ($array2[$j] === $lcs)
break;
$chunk2[] = $array2[$j];
$j++;
}
$diff[] = array ("type" => "Change",
"startLine1" => 1 + $i - count ($chunk1),
"endLine1" => $i,