Fixed to have a better character encoding detection of the git log.

This commit is contained in:
Loic d'Anterroches
2009-07-03 10:23:49 +02:00
parent 32507085b4
commit 7d6cb22291
4 changed files with 39 additions and 11 deletions

View File

@@ -40,12 +40,22 @@ class IDF_Tests_TestGit extends UnitTestCase
}
public function testGitCache()
/**
* parse a log encoded in iso 8859-1
*/
public function testParseIsoLog()
{
$repo = substr(dirname(__FILE__), 0, -strlen('src/IDF/Tests')).'/.git';
$repo = '/home/loa/Vendors/linux-git/.git';
$git = new IDF_Scm_Git($repo);
$git->buildBlobInfoCache();
//$git->getCachedBlobInfo(array());
$log_lines = preg_split("/\015\012|\015|\012/", file_get_contents(dirname(__FILE__).'/data/git-log-iso-8859-1.txt'));
$log = IDF_Scm_Git::parseLog($log_lines);
$titles = array(
'Quick Profiler entfernt',
'Anwendungsmenu Divider eingefügt',
'Anwendungen aufäumen'
);
foreach ($log as $change) {
$this->assertEqual(array_shift($titles),
IDF_Commit::toUTF8($change->title));
}
}
}
}

View File

@@ -0,0 +1,19 @@
commit 11531a9dbc64a65150f2f38fbea7cef9d478a123
Author: unknown <a@(none)>
Date: Fri Jul 3 01:44:11 2009 +0200
Quick Profiler entfernt
commit 11531a9dbc64a65150f2f38fbea7cef9d478a123
Author: unknown <a@(none)>
Date: Wed Jul 1 15:51:22 2009 +0200
Anwendungsmenu Divider eingef<65>gt
commit 11531a9dbc64a65150f2f38fbea7cef9d478a123
Author: unknown <a@(none)>
Date: Wed Jul 1 15:05:41 2009 +0200
Anwendungen auf<75>umen