Skip to content

Commit

Permalink
test: add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgw committed Oct 21, 2020
1 parent cac3251 commit c02f9dd
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ see also [the fixture file](test/fixtures/features.js).
| entry with trailing comma |||||||
| string key with colon |||||||
| entry key with colon |||||||
| entry value with annotation | | | | | | |
| entry label with number |||||||
| entry label with colon |||||||
| entry label with double quotes |||||||
Expand All @@ -165,8 +166,11 @@ see also [the fixture file](test/fixtures/features.js).
| entry value with uri fields | || | | | |
| entry value with pre-encoded uri fields |||| | ||
| entry value with diacritics |||||||
| entry value with escapes |||||||
| entry value with sub/superscript |||||||
| entry value with multi-argument commands |||||||
| entry value with verbatim-argument commands |||||||
| entry value with unbracketed-argument commands | ✘¹ | ✘¹ | ✘¹ | ✘¹ | ✘¹ ||
| TODO | | | | | | |
| string with lowercase type |||||||
| string with mixed-case type |||||||
Expand Down
39 changes: 39 additions & 0 deletions test/fixtures/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,24 @@ export default {
input: `@book{a, a:a = "foo" }`,
output: [{ type: 'book', id: 'a', properties: { 'a:a': 'foo' } }]
},
'entry value with annotation': {
input: `@MISC{ann1,
AUTHOR = {Last1, First1 and Last2, First2 and Last3, First3},
AUTHOR+an = {1:family=student;2=corresponding}
}`,
output: {
id: 'ann1',
properties: {
author: [
{ family: 'Last1', given: 'First1' },
{ family: 'Last2', given: 'First2' },
{ family: 'Last3', given: 'First3' }
]
},
type: 'misc'
},
only: 'biblatex'
},

// LABELS
'entry label with number': {
Expand Down Expand Up @@ -273,6 +291,27 @@ export default {
input: `@article{test, title = {$\\frac 1 2$ and $\\frac{n}{2}$}}`,
output: [{ id: 'test', properties: { title: '½ and ⁿ⁄₂' }, type: 'article'}]
},
'entry value with verbatim-argument commands': {
input: `@article{test, title = "\\href{http://example.org/{id}}{url}"}`,
output: [{
id: 'test',
properties: {
title: '<span class="nocase">http://example.org/{id}</span>'
},
type: 'article'
}]
},
'entry value with unbracketed-argument commands': {
input: `@article{test, title = {Stability analysis and \\emph optimization}}`,
output: [{
id: 'test',
properties: {
title: 'Stability analysis and <i>o</i>ptimization'
},
type: 'article'
}],
gimmick: 'REPRESENTATION'
},
// TODO
'TODO': {
only: 'display'
Expand Down

0 comments on commit c02f9dd

Please sign in to comment.