mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-12-04 04:38:08 +00:00
f230419baf
* Turned on wt2html and wt2wt Parsoid modes for all tests with aggressive normalization to eliminate the need to add html/parsoid sections. We expect these modes to pass. * The failing wt2wt tests is because the input wikitext duplicates arguments and Parsoid's wt2html doesn't capture duplicate template args which cause the wt2wt output to be normalized. This explains the two failing wt2wt tests and the corresponding selser "failures". * The failing wt2html safesubst test might be a real failure and something we will have to look into. Will file a phab task for this. * Added a new test for T272507 that fails with Parsoid right now, but will pass in a subsequent patch. Change-Id: I96fba68dda7524d2fe562eb60ced64e5e0518f65
25 lines
3.7 KiB
JSON
25 lines
3.7 KiB
JSON
{
|
||
"Scribunto: Test unstripNowiki behavior": {
|
||
"wt2html": "<p data-parsoid='{\"dsr\":[0,97,0,0]}'><span typeof=\"mw:Nowiki mw:Transclusion\" about=\"#mwt2\" data-parsoid='{\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"}]],\"dsr\":[0,46,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#invoke:EchoTest\",\"function\":\"invoke\"},\"params\":{\"1\":{\"wt\":\"echo\"},\"2\":{\"wt\":\"<nowiki>foo</nowiki>\"}},\"i\":0}}]}'>foo</span>\n<span typeof=\"mw:Nowiki mw:Transclusion\" about=\"#mwt6\" data-parsoid='{\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"}]],\"dsr\":[47,97,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#invoke:EchoTest\",\"function\":\"invoke\"},\"params\":{\"1\":{\"wt\":\"echo\"},\"2\":{\"wt\":\"<nowiki>[[Foo]]</nowiki>\"}},\"i\":0}}]}'>[[Foo]]</span></p>\n\n<p data-parsoid='{\"dsr\":[99,208,0,0]}'><span about=\"#mwt10\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"}]],\"dsr\":[99,151,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#invoke:UnstripTest\",\"function\":\"invoke\"},\"params\":{\"1\":{\"wt\":\"unstrip\"},\"2\":{\"wt\":\"<nowiki>foo</nowiki>\"}},\"i\":0}}]}'></span><span typeof=\"mw:Entity\" about=\"#mwt10\">'</span><span typeof=\"mw:Entity\" about=\"#mwt10\">\"</span><span about=\"#mwt10\">`UNIQ--nowiki-00000002-QINU`</span><span typeof=\"mw:Entity\" about=\"#mwt10\">\"</span><span typeof=\"mw:Entity\" about=\"#mwt10\">'</span><span about=\"#mwt10\"></span>\n<span about=\"#mwt12\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"},{\"k\":\"2\"}]],\"dsr\":[152,208,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"#invoke:UnstripTest\",\"function\":\"invoke\"},\"params\":{\"1\":{\"wt\":\"unstrip\"},\"2\":{\"wt\":\"<nowiki>[[Foo]]</nowiki>\"}},\"i\":0}}]}'></span><span typeof=\"mw:Entity\" about=\"#mwt12\">'</span><span typeof=\"mw:Entity\" about=\"#mwt12\">\"</span><span about=\"#mwt12\">`UNIQ--nowiki-00000003-QINU`</span><span typeof=\"mw:Entity\" about=\"#mwt12\">\"</span><span typeof=\"mw:Entity\" about=\"#mwt12\">'</span><span about=\"#mwt12\"></span></p>"
|
||
},
|
||
"Scribunto: isSubsting during PST": {
|
||
"wt2html": "<p data-parsoid='{\"dsr\":[0,37,0,0]}'><span about=\"#mwt1\" typeof=\"mw:Transclusion\" data-parsoid='{\"pi\":[[{\"k\":\"1\"}]],\"dsr\":[0,37,null,null]}' data-mw='{\"parts\":[{\"template\":{\"target\":{\"wt\":\"safesubst:#invoke:test\",\"function\":\"invoke\"},\"params\":{\"1\":{\"wt\":\"isSubsting\"}},\"i\":0}}]}'>false</span></p>"
|
||
},
|
||
"Scribunto: named numeric parameters": {
|
||
"wt2wt": "{{#invoke:test|getArg|b|a}}\n{{#invoke:test|getArg|a|b}}",
|
||
"selser [[0,3,0]]": "{{#invoke:test|getArg|2|a|2=b}}{{#invoke:test|getArg|2|2=a|b}}",
|
||
"selser [2]": "1pjtrsw\n\n{{#invoke:test|getArg|2|a|2=b}}\n{{#invoke:test|getArg|2|2=a|b}}",
|
||
"selser [[0,2,0]]": "{{#invoke:test|getArg|2|a|2=b}}lf2d8h\n{{#invoke:test|getArg|2|2=a|b}}",
|
||
"selser [1]": "{{#invoke:test|getArg|2|a|2=b}}\n{{#invoke:test|getArg|2|2=a|b}}",
|
||
"selser [[0,4,0]]": "{{#invoke:test|getArg|2|a|2=b}}1vmugjj{{#invoke:test|getArg|2|2=a|b}}"
|
||
},
|
||
"Scribunto: template-style argument trimming": {
|
||
"wt2wt": "{{#invoke:test|getArgLength|2| x }}\n{{#invoke:test|getArgLength|x}}",
|
||
"selser [[0,4,0]]": "{{#invoke:test|getArgLength|2| x }}149a6ep{{#invoke:test|getArgLength|2|2= x }}",
|
||
"selser [[0,3,0]]": "{{#invoke:test|getArgLength|2| x }}{{#invoke:test|getArgLength|2|2= x }}",
|
||
"selser [1]": "{{#invoke:test|getArgLength|2| x }}\n{{#invoke:test|getArgLength|2|2= x }}",
|
||
"selser [2]": "1pj31bg\n\n{{#invoke:test|getArgLength|2| x }}\n{{#invoke:test|getArgLength|2|2= x }}",
|
||
"selser [[0,2,0]]": "{{#invoke:test|getArgLength|2| x }}1ulspwn\n{{#invoke:test|getArgLength|2|2= x }}"
|
||
}
|
||
}
|