fix bug in author separation

This commit is contained in:
Martin Monperrus
2016-08-20 08:10:33 +02:00
parent 85a42ceb7c
commit 2f5e6c7d5d
2 changed files with 15 additions and 13 deletions
+4 -3
View File
@@ -456,7 +456,7 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$this->assertEquals("Meyer, Heribert and Foo Bar", $entry->getFormattedAuthorsString());
// Github issue 61
$bibtex = "@article{aKey61,title={An article Book},author = {Meyer, Heribert and {Advanced Air and Ground Research Team} and Foo Bar and J{\'e} Ko}}\n";
$bibtex = "@article{aKey61,title={An article Book},author = {Meyer, Heribert and {Advanced Air and Ground Research Team} and Foo Bar and J{\'e} Ko and J{\'e} Le and Fd L{\'e}}}\n";
// wrong parsing of author names
$test_data = fopen('php://memory','x+');
fwrite($test_data, $bibtex);
@@ -465,12 +465,13 @@ class BTBTest extends PHPUnit_Framework_TestCase {
$db->update_internal("inline", $test_data);
$entry = $db->getEntryByKey('aKey61');
$authors = $entry->getRawAuthors();
$this->assertEquals(4, count($authors));
$this->assertEquals(6, count($authors));
$this->assertEquals("Meyer, Heribert", $authors[0]);
$this->assertEquals("Advanced Air and Ground Research Team", $authors[1]);
$this->assertEquals("Foo Bar", $authors[2]);
$this->assertEquals("J{\'e} Ko", $authors[3]);
$this->assertEquals("Jé Ko", $entry->getFormattedAuthorsArray()[3]);
$this->assertEquals("J{\'e} Le", $authors[4]);
$this->assertEquals("Fd L{\'e}", $authors[5]);
}
function test_latex2html() {