Skip to content

Commit

Permalink
Add tests for non-CSL collection-title-short variable
Browse files Browse the repository at this point in the history
  • Loading branch information
fbennett committed Jan 19, 2019
1 parent 4f7dabd commit ea6a1e9
Show file tree
Hide file tree
Showing 2 changed files with 254 additions and 0 deletions.
128 changes: 128 additions & 0 deletions tests/fixtures/local/variables_CollectionTitleShort.txt
@@ -0,0 +1,128 @@
>>===== MODE =====>>
bibliography
<<===== MODE =====<<


Test for https://github.com/Juris-M/citeproc-js/issues/96


>>===== RESULT =====>>
<div class="csl-bib-body">
<div class="csl-entry">Series: a title</div>
<div class="csl-entry">Series</div>
</div>
<<===== RESULT =====<<


>>===== CITATIONS =====>>
[
[
{
"citationID": "CITATION-1",
"citationItems": [
{
"id": "ITEM-1"
},
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 1
}
},
[],
[]
]
]
<<===== CITATIONS =====<<


>>===== CSL =====>>
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" page-range-format="minimal">
<info>
<title>Vancouver</title>
<id>http://www.zotero.org/styles/vancouver</id>
<link href="http://www.zotero.org/styles/vancouver" rel="self"/>
<link href="http://www.nlm.nih.gov/bsd/uniform_requirements.html" rel="documentation"/>
<author>
<name>Michael Berkowitz</name>
<email>mberkowi@gmu.edu</email>
</author>
<contributor>
<name>Sean Takats</name>
<email>stakats@gmu.edu</email>
</contributor>
<contributor>
<name>Sebastian Karcher</name>
</contributor>
<category citation-format="numeric"/>
<category field="medicine"/>
<summary>Vancouver style as outlined by International Committee of Medical Journal Editors Uniform Requirements for Manuscripts Submitted to Biomedical Journals: Sample References</summary>
<updated>2014-09-06T16:03:01+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<citation>
<layout>
<text value="BOGUS"/>
</layout>
</citation>
<bibliography>
<layout>
<choose>
<if type="chapter">
<text variable="collection-title"/>
</if>
<else-if type="article-journal">
<text variable="collection-title" form="short"/>
</else-if>
</choose>
</layout>
</bibliography>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"type": "chapter",
"title": "Main title",
"source": "Zotero",
"collection-title": "Series: a title",
"collection-title-short": "Series",
"language": "en",
"author": [
{
"family": "Campbell",
"given": "Donald T"
},
{
"family": "Fiske",
"given": "Donald W"
}
]
},
{
"id": "ITEM-2",
"type": "article-journal",
"title": "Main title",
"source": "Zotero",
"collection-title": "Series: a title",
"collection-title-short": "Series",
"language": "en",
"author": [
{
"family": "Campbell",
"given": "Donald T"
},
{
"family": "Fiske",
"given": "Donald W"
}
]
}
]
<<===== INPUT =====<<
126 changes: 126 additions & 0 deletions tests/fixtures/local/variables_CollectionTitleShort2.txt
@@ -0,0 +1,126 @@
>>===== MODE =====>>
bibliography
<<===== MODE =====<<

Test for https://github.com/Juris-M/citeproc-js/issues/96

>>===== RESULT =====>>
<div class="csl-bib-body">
<div class="csl-entry">Series: a title</div>
<div class="csl-entry">Series</div>
</div>
<<===== RESULT =====<<


>>===== CITATIONS =====>>
[
[
{
"citationID": "CITATION-1",
"citationItems": [
{
"id": "ITEM-1"
},
{
"id": "ITEM-2"
}
],
"properties": {
"noteIndex": 1
}
},
[],
[]
]
]
<<===== CITATIONS =====<<


>>===== CSL =====>>
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" page-range-format="minimal">
<info>
<title>Vancouver</title>
<id>http://www.zotero.org/styles/vancouver</id>
<link href="http://www.zotero.org/styles/vancouver" rel="self"/>
<link href="http://www.nlm.nih.gov/bsd/uniform_requirements.html" rel="documentation"/>
<author>
<name>Michael Berkowitz</name>
<email>mberkowi@gmu.edu</email>
</author>
<contributor>
<name>Sean Takats</name>
<email>stakats@gmu.edu</email>
</contributor>
<contributor>
<name>Sebastian Karcher</name>
</contributor>
<category citation-format="numeric"/>
<category field="medicine"/>
<summary>Vancouver style as outlined by International Committee of Medical Journal Editors Uniform Requirements for Manuscripts Submitted to Biomedical Journals: Sample References</summary>
<updated>2014-09-06T16:03:01+00:00</updated>
<rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
</info>
<citation>
<layout>
<text value="BOGUS"/>
</layout>
</citation>
<bibliography>
<layout>
<choose>
<if type="chapter">
<text variable="collection-title"/>
</if>
<else-if type="article-journal">
<text variable="collection-title" form="short"/>
</else-if>
</choose>
</layout>
</bibliography>
</style>
<<===== CSL =====<<


>>===== INPUT =====>>
[
{
"id": "ITEM-1",
"type": "chapter",
"title": "CONVERGENT AND DISCRIMINANT VALIDATION BY THE MULTITRAIT-MULTIMETHOD MATRIX",
"page": "25",
"source": "Zotero",
"note": "collection-title: Series: a title\ncollection-title-short: Series\ncollection-title: Container: a title\ncollection-title-short: Container",
"language": "en",
"author": [
{
"family": "Campbell",
"given": "Donald T"
},
{
"family": "Fiske",
"given": "Donald W"
}
]
},
{
"id": "ITEM-2",
"type": "article-journal",
"title": "CONVERGENT AND DISCRIMINANT VALIDATION BY THE MULTITRAIT-MULTIMETHOD MATRIX",
"page": "25",
"source": "Zotero",
"note": "collection-title: Series: a title\ncollection-title-short: Series\ncollection-title: Container: a title\ncollection-title-short: Container",
"language": "en",
"author": [
{
"family": "Campbell",
"given": "Donald T"
},
{
"family": "Fiske",
"given": "Donald W"
}
]
}
]
<<===== INPUT =====<<

0 comments on commit ea6a1e9

Please sign in to comment.