summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json130
1 files changed, 130 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json
new file mode 100644
index 00000000..a0535128
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0501.json
@@ -0,0 +1,130 @@
+{
+ "description": "Test `_qty` queries for custom unit (km²/°C) property value assignments",
+ "setup": [
+ {
+ "namespace": "SMW_NS_PROPERTY",
+ "page": "Area",
+ "contents": "[[Has type::Quantity]] [[Corresponds to::1 km²]][[Corresponds to::1000 m²]][[Corresponds to::0.38610 sq mi]][[Corresponds to::247.1054 acre]][[Corresponds to::988.4215 rood]]"
+ },
+ {
+ "namespace": "SMW_NS_PROPERTY",
+ "page": "Has average high temperature",
+ "contents": "[[Has type::Temperature]]"
+ },
+ {
+ "page": "Berlin",
+ "contents": "[[Area::891.85 km²]], [[Has average high temperature::13.4 °C]]"
+ },
+ {
+ "page": "Paris",
+ "contents": "[[Area::105.40 km²]], [[Has average high temperature::16.0 °C]]"
+ },
+ {
+ "page": "東京都",
+ "contents": "[[Area::845 sq mi]], [[Has average high temperature::26.0 °C]]"
+ }
+ ],
+ "tests": [
+ {
+ "type": "query",
+ "about": "#0 Wildcard search for any value",
+ "condition": "[[Area::+]]",
+ "printouts": [
+ "Area"
+ ],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "results": [
+ "Berlin#0##",
+ "Paris#0##",
+ "東京都#0##"
+ ],
+ "count": "3",
+ "datavalues": [
+ {
+ "property": "Area",
+ "value": "891.85 km²"
+ },
+ {
+ "property": "Area",
+ "value": "105.40 km²"
+ },
+ {
+ "property": "Area",
+ "value": "845 sq mi"
+ }
+ ]
+ }
+ },
+ {
+ "type": "query",
+ "about": "#1 Search for distinct value",
+ "condition": "[[Area::891.85]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "results": [
+ "Berlin#0##"
+ ],
+ "count": "1"
+ }
+ },
+ {
+ "type": "query",
+ "about": "#2 Search for less than distinct value",
+ "condition": "[[Has average high temperature::<15.0 °C]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "results": [
+ "Berlin#0##"
+ ],
+ "count": "1"
+ }
+ },
+ {
+ "type": "query",
+ "about": "#3 Search for greater than or equal distinct value",
+ "condition": "[[Has average high temperature::≥16.0 °C]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "results": [
+ "Paris#0##",
+ "東京都#0##"
+ ],
+ "count": "2"
+ }
+ },
+ {
+ "type": "query",
+ "about": "#4 Search for greater than distinct value",
+ "condition": "[[Has average high temperature::>70 °F]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "results": [
+ "東京都#0##"
+ ],
+ "count": "1"
+ }
+ }
+ ],
+ "settings": {
+ "smwStrictComparators": false
+ },
+ "meta": {
+ "version": "2",
+ "debug": false
+ }
+} \ No newline at end of file