diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json new file mode 100644 index 00000000..65bf2844 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0502.json @@ -0,0 +1,84 @@ +{ + "description": "Test `_qty` range queries using non strict comparators (`smwStrictComparators=false`)", + "setup": [ + { + "namespace": "SMW_NS_PROPERTY", + "page": "Has starting wattage", + "contents": "[[Has type::Quantity]] [[Display units::kW]] [[Corresponds to::1 W, Watt, Watts]] [[Corresponds to::0.001 kW]] [[Corresponds to::0.0013410220 hp, bhp, horsepower]]" + }, + { + "namespace": "SMW_NS_PROPERTY", + "page": "Has running wattage", + "contents": "[[Has type::Quantity]] [[Display units::kW]] [[Corresponds to::1 W, Watt, Watts]] [[Corresponds to::0.001 kW]] [[Corresponds to::0.0013410220 hp, bhp, horsepower]]" + }, + { + "page": "Home appliance", + "contents": "{{#subobject:MicrowaveOven|Has starting wattage=1 kW|Has running wattage=1 kW}} {{#subobject:Refrigerator|Has starting wattage=1.2 kW|Has running wattage=130 W}} {{#subobject:Dishwasher|Has starting wattage=540 W|Has running wattage=200 W}} {{#subobject:Blender|Has starting wattage=840 W|Has running wattage=400 W}}" + } + ], + "tests": [ + { + "type": "query", + "about": "#0", + "condition": "[[Has starting wattage::≥1 kW]]", + "printouts": [ + "Has starting wattage" + ], + "parameters": { + "limit": "10" + }, + "assert-queryresult": { + "results": [ + "Home appliance#0##MicrowaveOven", + "Home appliance#0##Refrigerator" + ], + "count": "2", + "datavalues": [ + { + "property": "Has starting wattage", + "value": "1.2 kW" + }, + { + "property": "Has starting wattage", + "value": "1 kW" + } + ] + } + }, + { + "type": "query", + "about": "#1 Conjunctive condition", + "condition": "[[Has starting wattage::≥1 kW]] [[Has running wattage::< 500 W]]", + "printouts": [ + "Has starting wattage", + "Has running wattage" + ], + "parameters": { + "limit": "10" + }, + "assert-queryresult": { + "results": [ + "Home appliance#0##Refrigerator" + ], + "count": "1", + "datavalues": [ + { + "property": "Has starting wattage", + "value": "1.2 kW" + }, + { + "property": "Has running wattage", + "value": "130 W" + } + ] + } + } + ], + "settings": { + "smwStrictComparators": false + }, + "meta": { + "version": "2", + "debug": false + } +}
\ No newline at end of file |