test for monthnumber template as found on en.wikipedia, which currently is broken
1 --- a/tests/test_expander.py Tue Nov 18 10:51:41 2008 +0100
2 +++ b/tests/test_expander.py Tue Nov 18 11:31:31 2008 +0100
3 @@ -357,3 +357,7 @@
4 def test_noinclude_end():
5 expandstr("{{foo}}", "foo", wikidb=DictDB(foo="foo<noinclude>bar should not be in expansion"))
6
7 +def test_monthnumber():
8 + wikidb = DictDB(MONTHNUMBER="{{#if:{{{1|}}}|{{#switch:{{lc:{{{1}}}}}|january|jan=1|february|feb=2|march|mar=3|apr|april=4|may=5|june|jun=6|july|jul=7|august|aug=8|september|sep=9|october|oct=10|november|nov=11|december|dec=12|{{#ifexpr:{{{1}}}<0|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}}}|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}}}}}|Missing required parameter 1=''month''!}}")
9 +
10 + expandstr("{{MONTHNUMBER|12}}", "12", wikidb=wikidb)