diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json | 218 |
1 files changed, 218 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json new file mode 100644 index 00000000..8e1dee32 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json @@ -0,0 +1,218 @@ +{ + "description": "Test in-text `_num`, `_qty` in combination with an \"Allows value\" range, bounds", + "setup": [ + { + "page": "Has ranged number", + "namespace":"SMW_NS_PROPERTY", + "contents": "[[Has type::Number]], [[Allows value::>1]] [[Allows value::<10]] [[Allows value::20]]" + }, + { + "page": "Has bounded number", + "namespace":"SMW_NS_PROPERTY", + "contents": "[[Has type::Number]], [[Allows value::1..10]] [[Allows value::50...60]] [[Allows value::70]]" + }, + { + "page": "Has bounded quantity", + "namespace":"SMW_NS_PROPERTY", + "contents": "[[Has type::Quantity]], [[Allows value::1..200]] [[Corresponds to::1 km²]] [[Corresponds to::0.38613 sq mi]] [[Corresponds to::1000 m²]]" + }, + { + "page": "Example/P0460/1", + "namespace":"NS_MAIN", + "contents": "[[Has ranged number::2]]" + }, + { + "page": "Example/P0460/2", + "namespace":"NS_MAIN", + "contents": "[[Has ranged number::20]]" + }, + { + "page": "Example/P0460/3", + "namespace":"NS_MAIN", + "contents": "[[Has ranged number::10]]" + }, + { + "page": "Example/P0460/4", + "namespace":"NS_MAIN", + "contents": "[[Has bounded number::1]]" + }, + { + "page": "Example/P0460/5", + "namespace":"NS_MAIN", + "contents": "[[Has bounded number::60]]" + }, + { + "page": "Example/P0460/6", + "namespace":"NS_MAIN", + "contents": "[[Has bounded number::70]]" + }, + { + "page": "Example/P0460/7", + "namespace":"NS_MAIN", + "contents": "[[Has bounded number::60.1]]" + }, + { + "page": "Example/P0460/8", + "namespace":"NS_MAIN", + "contents": "[[Has bounded quantity::200m²]]" + }, + { + "page": "Example/P0460/9", + "namespace":"NS_MAIN", + "contents": "[[Has bounded quantity::200.1km²]]" + } + ], + "tests": [ + { + "type": "parser", + "about": "#0 (number, inside the number range)", + "subject": "Example/P0460/1", + "assert-output": { + "to-contain": [ + "2" + ] + } + }, + { + "type": "parser", + "about": "#1 (number, outside of number range but matches discrete value)", + "subject": "Example/P0460/2", + "assert-output": { + "to-contain": [ + "20" + ] + } + }, + { + "type": "parser", + "about": "#2 (1.31-) (number, invalid, outside of specified range)", + "skip-on": { + "mediawiki": [ ">1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/3", + "assert-output": { + "to-contain": [ + "10<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""10" is not in the list (>1, ) of allowed values for the "Has ranged number" property.\">" + ] + } + }, + { + "type": "parser", + "about": "#2 (1.31+) (number, invalid, outside of specified range)", + "skip-on": { + "mediawiki": [ "<1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/3", + "assert-output": { + "to-contain": [ + "10<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""10" is not in the list (>1, ) of allowed values for the "Has ranged number" property.\">" + ] + } + }, + { + "type": "parser", + "about": "#3 (number, inside the bounds)", + "subject": "Example/P0460/4", + "assert-output": { + "to-contain": [ + "1" + ] + } + }, + { + "type": "parser", + "about": "#4 (number, inside the seconds bounds)", + "subject": "Example/P0460/5", + "assert-output": { + "to-contain": [ + "60" + ] + } + }, + { + "type": "parser", + "about": "#5 (number, outside the bounds but matches discrete value)", + "subject": "Example/P0460/6", + "assert-output": { + "to-contain": [ + "70" + ] + } + }, + { + "type": "parser", + "about": "#6 (1.31-) (number, invalid, outside of specified bounds)", + "skip-on": { + "mediawiki": [ ">1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/7", + "assert-output": { + "to-contain": [ + "60.1<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""60.1" is not in the list (1..10, 50...60, 70) of allowed values for the "Has bounded number" property.\">" + ] + } + }, + { + "type": "parser", + "about": "#6 (1.31+) (number, invalid, outside of specified bounds)", + "skip-on": { + "mediawiki": [ "<1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/7", + "assert-output": { + "to-contain": [ + "60.1<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""60.1" is not in the list (1..10, 50...60, 70) of allowed values for the "Has bounded number" property.\">" + ] + } + }, + { + "type": "parser", + "about": "#7 (quantity, inside the bounds)", + "subject": "Example/P0460/8", + "assert-output": { + "to-contain": [ + "0.2 km²" + ] + } + }, + { + "type": "parser", + "about": "#8 (1.31-) (quantity, invalid, outside of specified range, bounds)", + "skip-on": { + "mediawiki": [ ">1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/9", + "assert-output": { + "to-contain": [ + "200.1km²<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""200.1 km²" is not within that range of "1..200" specified by the allows value constraint for the "Has bounded quantity" property.\">" + ] + } + }, + { + "type": "parser", + "about": "#8 (1.31+) (quantity, invalid, outside of specified range, bounds)", + "skip-on": { + "mediawiki": [ "<1.30.x", "MediaWiki changed the HTML Tidy" ] + }, + "subject": "Example/P0460/9", + "assert-output": { + "to-contain": [ + "200.1km²<span class=\"smw-highlighter\" data-type=\"4\" data-state=\"inline\" data-title=\"Warning\" title=\""200.1 km²" is not within that range of "1..200" specified by the allows value constraint for the "Has bounded quantity" property.\">" + ] + } + } + ], + "settings": { + "wgContLang": "en", + "wgLang": "en", + "smwgNamespacesWithSemanticLinks": { + "NS_MAIN": true, + "SMW_NS_PROPERTY": true + } + }, + "meta": { + "version": "2", + "is-incomplete": false, + "debug": false + } +} |