summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/JSONScript/TestCases/p-0460.json
blob: 8e1dee32aaf787cceb1d1cad88f04a00786593ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
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=\"&quot;10&quot; is not in the list (&gt;1, ) of allowed values for the &quot;Has ranged number&quot; 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=\"&quot;10&quot; is not in the list (&gt;1, ) of allowed values for the &quot;Has ranged number&quot; 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=\"&quot;60.1&quot; is not in the list (1..10, 50...60, 70) of allowed values for the &quot;Has bounded number&quot; 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=\"&quot;60.1&quot; is not in the list (1..10, 50...60, 70) of allowed values for the &quot;Has bounded number&quot; 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=\"&quot;200.1 km²&quot; is not within that range of &quot;1..200&quot; specified by the allows value constraint for the &quot;Has bounded quantity&quot; 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=\"&quot;200.1 km²&quot; is not within that range of &quot;1..200&quot; specified by the allows value constraint for the &quot;Has bounded quantity&quot; property.\">"
				]
			}
		}
	],
	"settings": {
		"wgContLang": "en",
		"wgLang": "en",
		"smwgNamespacesWithSemanticLinks": {
			"NS_MAIN": true,
			"SMW_NS_PROPERTY": true
		}
	},
	"meta": {
		"version": "2",
		"is-incomplete": false,
		"debug": false
	}
}