Fixed bug in the diff display when a single empty line was removed.

This commit is contained in:
Loic d'Anterroches
2009-02-02 21:42:31 +01:00
parent d594b3412a
commit b7d1afb01e
3 changed files with 72 additions and 1 deletions

View File

@@ -79,4 +79,15 @@ class IDF_Tests_TestDiff extends UnitTestCase
$this->assertEqual(2, count($diff->files));
$this->assertEqual(12, count($diff->files['src/IDF/conf/idf.php-dist']['chunks'][0]));
}
public function testDiffRemoveOneLine()
{
$diff_content = file_get_contents(dirname(__FILE__).'/test-diff-remove-oneline.diff');
$diff = new IDF_Diff($diff_content);
$diff->parse();
$this->assertEqual(2, count($diff->files));
$this->assertEqual(array(280, 288, ''),
$diff->files['src/IDF/Scm/Git.php']['chunks'][1][2]);
$this->assertEqual(7, count($diff->files['src/IDF/Scm/Git.php']['chunks'][1]));
}
}