1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-09 08:45:55 +02:00
joplin/packages/fork-sax/test/issue-86.js
2020-11-05 16:58:23 +00:00

86 lines
1.2 KiB
JavaScript

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: {}
})