gplx/mediawiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0411.json

186 lines
4.7 KiB
JSON
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"description": "Test in-text annotation (and #subobject) using a monolingual property (#1344, en)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has text with language",
"contents": "[[Has type::Monolingual text]]"
},
{
"page": "Example/P0411/1",
"contents": "[[Has text with language::example one@en]]"
},
{
"page": "Example/P0411/1/1",
"contents": "{{#ask: [[Has text with language::example one@en]] |?Has text with language }}"
},
{
"page": "Example/P0411/1/2",
"contents": "{{#ask: [[-Has text with language::Example/P0411/1]] |?Language code |?Text }}"
},
{
"page": "Example/P0411/2",
"contents": "{{#subobject: |Has text with language=例の一@ja }} {{#subobject: |Has text with language=pour l'exemple@fr }}"
},
{
"page": "Example/P0411/2/1",
"contents": "{{#ask: [[Has text with language::?@ja]] |?Has text with language }}"
},
{
"page": "Example/P0411/2/2",
"contents": "{{#ask: [[Language code::ja]] |?Text }}"
},
{
"page": "Example/P0411/2/3",
"contents": "{{#ask: [[Language code::ja]] |?-Has text with language }}"
},
{
"page": "Example/P0411/3",
"contents": "{{#subobject: |Has text with language=国@zh-hans }} {{#subobject: |Has text with language=國@zh-hant }}"
},
{
"page": "Example/P0411/3/1",
"contents": "{{#ask: [[Has text with language::?@~zh*]] |?Has text with language=Text |+index=1 |?Has text with language=Code |+index=2 }}"
},
{
"page": "P0411/4",
"contents": "{{#subobject:Test1 |Has text with language=例の一@ja }} {{#subobject:Test2 |Has text with language=pour l'exemple@fr }}"
},
{
"page": "P0411/Q4.1",
"contents": "{{#show: P0411/4#Test1 |?Has text with language }}"
},
{
"page": "P0411/Q4.2",
"contents": "{{#show: P0411/4#Test1 |?Has text with language|+lang=ja }}"
}
],
"tests": [
{
"type": "parser",
"about": "#0",
"subject": "Example/P0411/1",
"assert-store": {
"semantic-data": {
"strictPropertyValueMatch": false,
"propertyCount": 3,
"propertyKeys": [
"Has_text_with_language",
"_SKEY",
"_MDAT"
],
"propertyValues": []
}
},
"assert-output": {
"to-contain": [
"example one (en)"
]
}
},
{
"type": "parser",
"about": "#1 match subject",
"subject": "Example/P0411/1/1",
"assert-output": {
"to-contain": [
"Example/P0411/1",
"class=\"Has-text-with-language smwtype_mlt_rec\">example one (en)"
]
}
},
{
"type": "parser",
"about": "#2 inverse match",
"subject": "Example/P0411/1/2",
"assert-output": {
"to-contain": [
"Example/P0411/1#_ML3c1364d804527cd1594b4817b01c29f0",
"class=\"Language-code smwtype__lcode\">en",
"class=\"Text smwtype_txt\">example one"
]
}
},
{
"type": "parser",
"about": "#3 match specific language",
"subject": "Example/P0411/2/1",
"assert-output": {
"to-contain": [
"Example/P0411/2#_b88331e53ca614aea6f7c8b5f0d6f876",
"class=\"Has-text-with-language smwtype_mlt_rec\">例の一 (ja)"
]
}
},
{
"type": "parser",
"about": "#4 match specific language",
"subject": "Example/P0411/2/2",
"assert-output": {
"to-contain": [
"Example/P0411/2#_ML13e9d4c2ba826927d7210acab7def9ec",
"class=\"Text smwtype_txt\">例の一"
]
}
},
{
"type": "parser",
"about": "#5 match specific language with inverse printout",
"subject": "Example/P0411/2/3",
"assert-output": {
"to-contain": [
"Example/P0411/2#_ML13e9d4c2ba826927d7210acab7def9ec",
"title=\"Property:Has text with language\">-Has text with language",
"class=\"-Has-text-with-language smwtype_mlt_rec\">Example/P0411/2"
]
}
},
{
"type": "parser",
"about": "#6 using index display for columns",
"subject": "Example/P0411/3/1",
"assert-output": {
"to-contain": [
"Example/P0411/3#_a52273132da28d0c1fad5819e44958ab",
"class=\"Text smwtype_txt\">国",
"class=\"Code smwtype__lcode\">zh-Hans",
"Example/P0411/3#_4eac5791ab0478bb01dc9d181bc91ec8",
"class=\"Text smwtype_txt\">國",
"class=\"Code smwtype__lcode\">zh-Hant"
]
}
},
{
"type": "parser",
"about": "#7 (#show, subobject)",
"subject": "P0411/Q4.1",
"assert-output": {
"to-contain": [
"例の一 (ja)"
]
}
},
{
"type": "parser",
"about": "#8 (#show, subobject, +lang)",
"subject": "P0411/Q4.2",
"assert-output": {
"to-contain": [
"例の一"
],
"not-contain": [
"例の一 (ja)"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en"
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}