r96505 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96504‎ | r96505 | r96506 >
Date:21:39, 7 September 2011
Author:happy-melon
Status:ok
Tags:
Comment:
FU 96499, r81074: fix parser tests to reflect the change in default dialect, and make them not run (and die) when {{#convert}} is disabled.
Modified paths:
  • /trunk/extensions/ParserFunctions/convertTests.txt (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/convertTests.txt
@@ -1,3 +1,7 @@
 2+!! functionhooks
 3+convert
 4+!! endfunctionhooks
 5+
26 !! test
37 Simple conversion
48 !! input
@@ -3,5 +7,5 @@
48 {{#convert: 10 m | km }}
59 !!result
6 -<p>0.01 kilometers
 10+<p>0.01 kilometres
711 </p>
812 !! end
@@ -19,14 +23,14 @@
2024 *{{#convert: 10.0E2 km | m }}
2125 *{{#convert: 10.0E2.5 km | m }}
2226 !! 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
3135 </li></ul>
3236
3337 !! end
@@ -46,17 +50,17 @@
4751 *{{#convert: 19 m | km }}
4852 *{{#convert: 20 m | km }}
4953 !! 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
6165 </li></ul>
6266
6367 !! end
@@ -73,14 +77,14 @@
7478 *{{#convert: 10.6 m | km }}
7579 *{{#convert: 10.7 m | km }}
7680 !! 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
8589 </li></ul>
8690
8791 !! end
@@ -90,7 +94,7 @@
9195 !! input
9296 {{#convert: 25, 26, 27, 28, 29, and 30 km }}
9397 !! 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
9599 </p>
96100 !! end
97101
@@ -99,7 +103,7 @@
100104 !! input
101105 {{#convert: 25, 26, 27, 28, 29, and 30 miles }}
102106 !! 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
104108 </p>
105109 !! end
106110
@@ -108,7 +112,7 @@
109113 !! input
110114 {{#convert:35000, 35E3, 35.0E3, 350E2, 3.500E4, 35000E0, 350000E-1 m | km }}
111115 !! 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
113117 </p>
114118 !! end
115119
@@ -120,10 +124,10 @@
121125 *{{#convert: 25 | #sourceunit = km | #sourceunit = mm }}
122126 *{{#convert: 25 | #sourceunit = km | cm }}
123127 !! 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
128132 </li></ul>
129133
130134 !! end
@@ -142,16 +146,16 @@
143147 *{{#convert: 1 mi | #sf = 5 }}
144148 *{{#convert: 1 mi | #sf = -8 }}
145149 !! 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
156160 </li></ul>
157161
158162 !! end
@@ -186,8 +190,8 @@
187191 *{{#convert: 25 km | #targetunit = #sourceunit }}
188192 *{{#convert: 25 km | #sourceunit = #targetunit }}
189193 !! result
190 -<ul><li>25 kilometers
191 -</li><li>25 kilometers
 194+<ul><li>25 kilometres
 195+</li><li>25 kilometres
192196 </li></ul>
193197
194198 !! end
@@ -196,14 +200,14 @@
197201 #language
198202 !! input
199203 *{{#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 }}
203207 !! result
204208 <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
208212 </li></ul>
209213
210214 !! end
@@ -217,10 +221,10 @@
218222 *{{#convert: 10 Pa | mmHg }}
219223 *{{#convert: 10 pa | mmHg }}
220224 !! 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
225229 </li><li><strong class="error">Error: Unknown unit "pa".</strong>
226230 </li></ul>
227231

Follow-up revisions

RevisionCommit summaryAuthorDate
r96933REL1_18: MFT r96499, r96502, r96505reedy00:36, 13 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81074(bug 235) parser function for conversion of units of measurement....happy-melon00:13, 27 January 2011
r96499Follow-up r81074:...happy-melon21:06, 7 September 2011

Status & tagging log