{
"description": "Test `Special:Ask` output on `mainlabel=.../?#...`, `format=table`",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has page extra",
"contents": "[[Has type::Page]]"
},
{
"page": "Example/SA0012/1",
"contents": "[[Has page extra::123]] [[Category:SA0012]]"
}
],
"tests": [
{
"type": "special",
"about": "#0 (?#, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"
",
"Has page extra| | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#0.1 (?, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#1 (?#, mainlabel=-, output the same as in #0)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23/mainlabel%3D-2D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#2 (?#, mainlabel=FOO, ?# takes precedence over mainlabel, same output as in #0)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23/mainlabel%3DFOO/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#3 (?#- forces plain output, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#4 (?#=Foo, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| Foo | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#4.1 (?=Foo, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F%3DFoo/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| Foo | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#5 (?#=Foo#- forces plain output, empty mainlabel)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23%3DFoo-23-2D/mainlabel%3D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| Foo | ",
"| Example/SA0012/1 | "
]
}
},
{
"type": "special",
"about": "#6 (?#=Foo#- forces plain output, mainlabel=-, same output as in #5)",
"special-page": {
"page": "Ask",
"query-parameters": "-5B-5BCategory:SA0012-5D-5D/-3FHas-20page-20extra/-3F-23%3DFoo-23-2D/mainlabel%3D-2D/offset%3D0/format%3Dtable",
"request-parameters": []
},
"assert-output": {
"to-contain": [
"",
"Has page extra| Foo | ",
"| Example/SA0012/1 | "
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLanguageCode": "en",
"smwgPageSpecialProperties": [
"_MDAT"
],
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"SMW_NS_PROPERTY": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}