summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json')
-rw-r--r--www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json87
1 files changed, 87 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json
new file mode 100644
index 00000000..ff650628
--- /dev/null
+++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/q-0503.json
@@ -0,0 +1,87 @@
+{
+ "description": "Test `_qty` on positional unit preference in query condition (#1329, `smwStrictComparators=false`)",
+ "setup": [
+ {
+ "namespace": "SMW_NS_PROPERTY",
+ "page": "Currency",
+ "contents": "[[Has type::Quantity]], [[Display units::€,£,¥]] [[Corresponds to::€ 1]] [[Corresponds to::1.06 US, US$, $]] [[Corresponds to::0.70 British Pound,GBP,£]] [[Corresponds to::¥,JPY,Japanese Yen 114.2121]]"
+ },
+ {
+ "page": "Example/Q0503/1",
+ "contents": "[[Currency::12 €]] [[Currency::¥ 500]] [[Currency::2 £]]"
+ },
+ {
+ "page": "Example/Q0503/2",
+ "contents": "[[Currency::€ 20]] [[Currency::2000 JPY]] [[Currency::0.5 GBP]]"
+ }
+ ],
+ "tests": [
+ {
+ "type": "query",
+ "about": "#0",
+ "condition": "[[Currency::€ 20]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "count": 1,
+ "results": [
+ "Example/Q0503/2#0##"
+ ]
+ }
+ },
+ {
+ "type": "query",
+ "about": "#1",
+ "condition": "[[Currency::<¥300]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "count": 1,
+ "results": [
+ "Example/Q0503/2#0##"
+ ]
+ }
+ },
+ {
+ "type": "query",
+ "about": "#2",
+ "condition": "[[Currency::≥1400 JPY]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "count": 1,
+ "results": [
+ "Example/Q0503/2#0##"
+ ]
+ }
+ },
+ {
+ "type": "query",
+ "about": "#3",
+ "condition": "[[Currency::< € .8]]",
+ "printouts": [],
+ "parameters": {
+ "limit": "10"
+ },
+ "assert-queryresult": {
+ "count": 1,
+ "results": [
+ "Example/Q0503/2#0##"
+ ]
+ }
+ }
+ ],
+ "settings": {
+ "smwStrictComparators": false
+ },
+ "meta": {
+ "version": "2",
+ "debug": false
+ }
+} \ No newline at end of file