1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/packages/fork-sax/test/issue-86.js

86 lines
1.2 KiB
JavaScript
Raw Normal View History

2020-11-05 18:58:23 +02:00
require(__dirname).test({
xml: '<root>abc</root>de<f',
expect: [
[
'opentagstart',
{
name: 'ROOT',
attributes: {}
}
],
[
'opentag',
{
name: 'ROOT',
attributes: {},
isSelfClosing: false
}
],
[
'text',
'abc'
],
[
'closetag',
'ROOT'
],
[
'text',
'de<f'
]
],
strict: false,
opt: {}
})
require(__dirname).test({
xml: '<root>abc</root>de<f',
expect: [
[
'opentagstart',
{
name: 'root',
attributes: {}
}
],
[
'opentag',
{
name: 'root',
attributes: {},
isSelfClosing: false
}
],
[
'text',
'abc'
],
[
'closetag',
'root'
],
[
'error',
'Text data outside of root node.\nLine: 0\nColumn: 17\nChar: d'
],
[
'text',
'd'
],
[
'error',
'Text data outside of root node.\nLine: 0\nColumn: 18\nChar: e'
],
[
'text',
'e'
],
[
'error',
'Unexpected end\nLine: 0\nColumn: 20\nChar: '
]
],
strict: true,
opt: {}
})