Commit ebc4f190 authored by User expired's avatar User expired
Browse files

test: Test for citation key letter from filename

parent 60798e35
......@@ -154,6 +154,12 @@ testYearWithLetter() {
sed '/^ Journal *=/d' -i $fileOne
assertEquals 'Czako2009c,' "$(bib-keyinsert ${fileOne}:c | cut -d'{' -f2)"
assertEquals '@Article{Czako2009c,' "$(head -n1 $fileOne)"
file=$(bib-name $fileOne | grep -o "[^']*.pdf.bib") # Filename from citation key.
assertEquals 'Letter in filename' '/tmp/Czako_2009c_.pdf.bib' "$file"
assertEquals 'Keep filename letter' '0' "$(bib-keyinsert -n $file 2>&1 | wc -l)"
mv $file ${file/c_/_} && file=${file/c_/_} # Remove letter from filename.
assertEquals 'Otherwise drop letter' '3' "$(bib-keyinsert -n $file 2>&1 | wc -l)"
mv $file $fileOne
testPrintKeys() {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment