mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-27 10:32:58 +02:00
86 lines
1.2 KiB
JavaScript
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: {}
|
|
})
|