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
|
{
"description": "Test `format=table` on `|+align=`/`|+limit`/`|+order`/`|+width=` extra printout parameters (T18571, en)",
"setup": [
{
"namespace": "SMW_NS_PROPERTY",
"page": "Has number",
"contents": "[[Has type::Number]]"
},
{
"page": "Example/F0205/1/1",
"contents": "[[Has number::1]] [[Has number::42]] [[Has number::.02]]"
},
{
"page": "Example/F0205/1/2",
"contents": "[[Has number::21]] [[Has number::1001]] [[Has number::2.02]]"
},
{
"page": "Example/F0205/1a",
"contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+align=right |+limit=2 |+order=asc |format=table |headers=plain }}"
},
{
"page": "Example/F0205/1b",
"contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+align=left |+limit=2 |+order=desc |format=table |headers=plain }}"
},
{
"page": "Example/F0205/Q.2",
"contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+width=50% |+limit=2 |+order=desc |format=table |headers=plain }}"
},
{
"page": "Example/F0205/Q.3",
"contents": "{{#ask: [[~Example/F0205/1/*]] |?Has number |+width=50% |+align=center |+limit=2 |+order=desc |format=table |headers=plain }}"
}
],
"tests": [
{
"type": "format",
"about": "#0",
"subject": "Example/F0205/1a",
"assert-output": {
"to-contain": [
"class=\"Has-number smwtype_num\" data-sort-value=\"0.02\" style=\"text-align:right;\">0.02<br />1",
"class=\"Has-number smwtype_num\" data-sort-value=\"2.02\" style=\"text-align:right;\">2.02<br />21"
]
}
},
{
"type": "format",
"about": "#1 (align, left)",
"subject": "Example/F0205/1b",
"assert-output": {
"to-contain": [
"class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"text-align:left;\">42<br />1",
"class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"text-align:left;\">1,001<br />21"
]
}
},
{
"type": "format",
"about": "#2 (+width)",
"subject": "Example/F0205/Q.2",
"assert-output": {
"to-contain": [
"<td class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"width:50%;\">42<br />1</td>",
"<td class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"width:50%;\">1,001<br />21</td>"
]
}
},
{
"type": "format",
"about": "#3 (+width, +align)",
"subject": "Example/F0205/Q.3",
"assert-output": {
"to-contain": [
"<td class=\"Has-number smwtype_num\" data-sort-value=\"42\" style=\"text-align:center; width:50%;\">42<br />1</td>",
"<td class=\"Has-number smwtype_num\" data-sort-value=\"1001\" style=\"text-align:center; width:50%;\">1,001<br />21</td>"
]
}
}
],
"settings": {
"wgContLang": "en",
"wgLang": "en",
"smwgNamespacesWithSemanticLinks": {
"NS_MAIN": true,
"SMW_NS_PROPERTY": true
}
},
"meta": {
"version": "2",
"is-incomplete": false,
"debug": false
}
}
|