Browse Source

added test data script

hg/35a367e65a464cf6cdf277c73f977a6828b723fe/bookmarks/master
Martin Monperrus 15 years ago
parent
commit
f5810496eb
  1. 40
      test/update-test-data.php

40
test/update-test-data.php

@ -0,0 +1,40 @@
<?
/*
update the test data:
then a bzr diff is the regression test
*/
$_GET['test']=1;
include('../bibtexbrowser.php');
$testbibs = array (
'bibacid-iso8859.bib',
'all.bib',
'metrics.bib',
'strings.bib;entries.bib'
);
foreach ($testbibs as $k) {
$db = new BibDataBase();
foreach(explode(MULTIPLE_BIB_SEPARATOR,$k) as $bibfile) {
$db->load($bibfile);
}
// sorting the entries
ksort($db->bibdb);
// sorting the fields
foreach($db->bibdb as $bib) {
ksort($bib->fields);
}
$result = '';
foreach($db->bibdb as $bib) {
$result .= var_export($bib->fields, true)."\n";
}
//echo $result;
file_put_contents($k.'.txt',$result);
}
?>
Loading…
Cancel
Save