Index: trunk/extensions/ParserFunctions/convertTests.txt |
— | — | @@ -1,3 +1,7 @@ |
| 2 | +!! functionhooks |
| 3 | +convert |
| 4 | +!! endfunctionhooks |
| 5 | + |
2 | 6 | !! test |
3 | 7 | Simple conversion |
4 | 8 | !! input |
— | — | @@ -3,5 +7,5 @@ |
4 | 8 | {{#convert: 10 m | km }} |
5 | 9 | !!result |
6 | | -<p>0.01 kilometers |
| 10 | +<p>0.01 kilometres |
7 | 11 | </p> |
8 | 12 | !! end |
— | — | @@ -19,14 +23,14 @@ |
20 | 24 | *{{#convert: 10.0E2 km | m }} |
21 | 25 | *{{#convert: 10.0E2.5 km | m }} |
22 | 26 | !! result |
23 | | -<ul><li>0.01 kilometers |
24 | | -</li><li>0.01kilometers |
25 | | -</li><li>10,000 meters |
26 | | -</li><li>10,000-meters |
27 | | -</li><li>1,000,000 meters |
28 | | -</li><li>100 meters |
29 | | -</li><li>1,000,000 meters |
30 | | -</li><li>1,000,000.5,000 meters |
| 27 | +<ul><li>0.01 kilometres |
| 28 | +</li><li>0.01kilometres |
| 29 | +</li><li>10,000 metres |
| 30 | +</li><li>10,000-metres |
| 31 | +</li><li>1,000,000 metres |
| 32 | +</li><li>100 metres |
| 33 | +</li><li>1,000,000 metres |
| 34 | +</li><li>1,000,000.5,000 metres |
31 | 35 | </li></ul> |
32 | 36 | |
33 | 37 | !! end |
— | — | @@ -46,17 +50,17 @@ |
47 | 51 | *{{#convert: 19 m | km }} |
48 | 52 | *{{#convert: 20 m | km }} |
49 | 53 | !! result |
50 | | -<ul><li>0.01 kilometers |
51 | | -</li><li>0.011 kilometers |
52 | | -</li><li>0.012 kilometers |
53 | | -</li><li>0.013 kilometers |
54 | | -</li><li>0.014 kilometers |
55 | | -</li><li>0.015 kilometers |
56 | | -</li><li>0.016 kilometers |
57 | | -</li><li>0.017 kilometers |
58 | | -</li><li>0.018 kilometers |
59 | | -</li><li>0.019 kilometers |
60 | | -</li><li>0.02 kilometers |
| 54 | +<ul><li>0.01 kilometres |
| 55 | +</li><li>0.011 kilometres |
| 56 | +</li><li>0.012 kilometres |
| 57 | +</li><li>0.013 kilometres |
| 58 | +</li><li>0.014 kilometres |
| 59 | +</li><li>0.015 kilometres |
| 60 | +</li><li>0.016 kilometres |
| 61 | +</li><li>0.017 kilometres |
| 62 | +</li><li>0.018 kilometres |
| 63 | +</li><li>0.019 kilometres |
| 64 | +</li><li>0.02 kilometres |
61 | 65 | </li></ul> |
62 | 66 | |
63 | 67 | !! end |
— | — | @@ -73,14 +77,14 @@ |
74 | 78 | *{{#convert: 10.6 m | km }} |
75 | 79 | *{{#convert: 10.7 m | km }} |
76 | 80 | !! result |
77 | | -<ul><li>0.0100 kilometers |
78 | | -</li><li>0.0101 kilometers |
79 | | -</li><li>0.0102 kilometers |
80 | | -</li><li>0.0103 kilometers |
81 | | -</li><li>0.0104 kilometers |
82 | | -</li><li>0.0105 kilometers |
83 | | -</li><li>0.0106 kilometers |
84 | | -</li><li>0.0107 kilometers |
| 81 | +<ul><li>0.0100 kilometres |
| 82 | +</li><li>0.0101 kilometres |
| 83 | +</li><li>0.0102 kilometres |
| 84 | +</li><li>0.0103 kilometres |
| 85 | +</li><li>0.0104 kilometres |
| 86 | +</li><li>0.0105 kilometres |
| 87 | +</li><li>0.0106 kilometres |
| 88 | +</li><li>0.0107 kilometres |
85 | 89 | </li></ul> |
86 | 90 | |
87 | 91 | !! end |
— | — | @@ -90,7 +94,7 @@ |
91 | 95 | !! input |
92 | 96 | {{#convert: 25, 26, 27, 28, 29, and 30 km }} |
93 | 97 | !! result |
94 | | -<p>25,000, 26,000, 27,000, 28,000, 29,000, and 30,000 meters |
| 98 | +<p>25,000, 26,000, 27,000, 28,000, 29,000, and 30,000 metres |
95 | 99 | </p> |
96 | 100 | !! end |
97 | 101 | |
— | — | @@ -99,7 +103,7 @@ |
100 | 104 | !! input |
101 | 105 | {{#convert: 25, 26, 27, 28, 29, and 30 miles }} |
102 | 106 | !! result |
103 | | -<p>40,000, 42,000, 43,000, 45,000, 47,000, and 50,000 meters |
| 107 | +<p>40,000, 42,000, 43,000, 45,000, 47,000, and 50,000 metres |
104 | 108 | </p> |
105 | 109 | !! end |
106 | 110 | |
— | — | @@ -108,7 +112,7 @@ |
109 | 113 | !! input |
110 | 114 | {{#convert:35000, 35E3, 35.0E3, 350E2, 3.500E4, 35000E0, 350000E-1 m | km }} |
111 | 115 | !! result |
112 | | -<p>35, 35, 35.0, 35, 35.00, 35, 35 kilometers |
| 116 | +<p>35, 35, 35.0, 35, 35.00, 35, 35 kilometres |
113 | 117 | </p> |
114 | 118 | !! end |
115 | 119 | |
— | — | @@ -120,10 +124,10 @@ |
121 | 125 | *{{#convert: 25 | #sourceunit = km | #sourceunit = mm }} |
122 | 126 | *{{#convert: 25 | #sourceunit = km | cm }} |
123 | 127 | !! result |
124 | | -<ul><li>25,000 meters |
125 | | -</li><li>25,000 meters |
126 | | -</li><li>0.025 meters |
127 | | -</li><li>2,500,000 centimeters |
| 128 | +<ul><li>25,000 metres |
| 129 | +</li><li>25,000 metres |
| 130 | +</li><li>0.025 metres |
| 131 | +</li><li>2,500,000 centimetres |
128 | 132 | </li></ul> |
129 | 133 | |
130 | 134 | !! end |
— | — | @@ -142,16 +146,16 @@ |
143 | 147 | *{{#convert: 1 mi | #sf = 5 }} |
144 | 148 | *{{#convert: 1 mi | #sf = -8 }} |
145 | 149 | !! result |
146 | | -<ul><li>1,609 meters |
147 | | -</li><li>1,609.3 meters |
148 | | -</li><li>1,600 meters |
149 | | -</li><li>1,609.344 meters |
150 | | -</li><li>0 meters |
151 | | -</li><li>2,000 meters |
152 | | -</li><li>2,000 meters |
153 | | -</li><li>1,610 meters |
154 | | -</li><li>1,609.3 meters |
155 | | -</li><li>2,000 meters |
| 150 | +<ul><li>1,609 metres |
| 151 | +</li><li>1,609.3 metres |
| 152 | +</li><li>1,600 metres |
| 153 | +</li><li>1,609.344 metres |
| 154 | +</li><li>0 metres |
| 155 | +</li><li>2,000 metres |
| 156 | +</li><li>2,000 metres |
| 157 | +</li><li>1,610 metres |
| 158 | +</li><li>1,609.3 metres |
| 159 | +</li><li>2,000 metres |
156 | 160 | </li></ul> |
157 | 161 | |
158 | 162 | !! end |
— | — | @@ -186,8 +190,8 @@ |
187 | 191 | *{{#convert: 25 km | #targetunit = #sourceunit }} |
188 | 192 | *{{#convert: 25 km | #sourceunit = #targetunit }} |
189 | 193 | !! result |
190 | | -<ul><li>25 kilometers |
191 | | -</li><li>25 kilometers |
| 194 | +<ul><li>25 kilometres |
| 195 | +</li><li>25 kilometres |
192 | 196 | </li></ul> |
193 | 197 | |
194 | 198 | !! end |
— | — | @@ -196,14 +200,14 @@ |
197 | 201 | #language |
198 | 202 | !! input |
199 | 203 | *{{#convert: 10 m | km | #language=en-gb }} |
200 | | -*{{#convert: 10m | km | #language = en-gb }} |
201 | | -*{{#convert: 10 km | m |#language=en-gb}} |
202 | | -*{{#convert: 10 Pa | mmHg | #language = en-gb }} |
| 204 | +*{{#convert: 10m | km | #language = en }} |
| 205 | +*{{#convert: 10 km | m |#language=en}} |
| 206 | +*{{#convert: 10 Pa | mmHg | #language = fr }} |
203 | 207 | !! result |
204 | 208 | <ul><li>0.01 kilometres |
205 | | -</li><li>0.01kilometres |
206 | | -</li><li>10,000 metres |
207 | | -</li><li>0.1 millimetres of mercury |
| 209 | +</li><li>0.01kilometers |
| 210 | +</li><li>10,000 meters |
| 211 | +</li><li>0.1 millimètre de mercure |
208 | 212 | </li></ul> |
209 | 213 | |
210 | 214 | !! end |
— | — | @@ -217,10 +221,10 @@ |
218 | 222 | *{{#convert: 10 Pa | mmHg }} |
219 | 223 | *{{#convert: 10 pa | mmHg }} |
220 | 224 | !! result |
221 | | -<ul><li>0.01 meters |
222 | | -</li><li>10,000,000 meters |
223 | | -</li><li>0.01 megameters |
224 | | -</li><li>0.1 millimeters of mercury |
| 225 | +<ul><li>0.01 metres |
| 226 | +</li><li>10,000,000 metres |
| 227 | +</li><li>0.01 megametres |
| 228 | +</li><li>0.1 millimetres of mercury |
225 | 229 | </li><li><strong class="error">Error: Unknown unit "pa".</strong> |
226 | 230 | </li></ul> |
227 | 231 | |