Module:Era/testcases
Jump to navigation
Jump to search
CodeDiscussionEditHistoryLinksLink count Subpages:DocumentationTestsResultsSandboxLive code All modules
Lua
Documentation for this module may be created at Module:Era/testcases/doc
Code
local p = require('Module:UnitTests')
function p:test_eras()
self:preprocess_equals_many('{{#invoke:Era|era|','}}', {
{'date=foo|lang=en|era=Ad', 'foo [[:en:Anno Domini|AD]]'},
{'date=foo|lang=en|era=ce', 'foo [[:en:Anno Domini|AD]]'},
{'date=foo|lang=en|era=bp', 'foo [[:en:Before Present|BP]]'},
{'date=foo|lang=en|era=BEFORE PRESENT', 'foo [[:en:Before Present|BP]]'},
{'date=booh|lang=en|era=ce', 'booh [[:en:Anno Domini|AD]]'},
{'date=2010-06|lang=en|era=ce', '2010-06 [[:en:Anno Domini|AD]]'},
{'date=booh|lang=en|era=fake era', 'booh FAKE ERA'},
{'date=|lang=en', ''},
{'date=|lang=en|era=ce', ''},
{'|lang=en|era=ce', ''},
{'', ''},
{'date=booh|lang=en|era= ', 'booh'},
})
end
function p:test_AD()
self:preprocess_equals_many('{{#invoke:Era|era|','}}', {
{'date=foo|lang=bn|era=AD', 'foo খ্রিস্টাব্দ'},
{'date=foo|lang=ca|era=AD', 'foo dC'},
{'date=foo|lang=cs|era=AD', 'foo n. l.'},
{'date=foo|lang=de|era=AD', 'foo n. Chr.'},
{'date=foo|lang=el|era=AD', 'foo μ.Χ.'},
{'date=foo|lang=en|era=AD', 'foo [[:en:Anno Domini|AD]]'},
{'date=foo|lang=es|era=AD', 'foo d.C.'},
{'date=foo|lang=fa|era=AD', 'foo م.'},
{'date=foo|lang=fi|era=AD', 'foo jaa.'},
{'date=foo|lang=fr|era=AD', 'foo ap. J.-C.'},
{'date=foo|lang=gl|era=AD', 'foo d.C.'},
{'date=foo|lang=he|era=AD', 'foo לספירה'},
{'date=foo|lang=it|era=AD', 'foo d.C.'},
{'date=foo|lang=ja|era=AD', '西暦foo'},
{'date=foo|lang=mk|era=AD', 'foo н.е.'},
{'date=foo|lang=ml|era=AD', 'ക്രി.വ. foo'},
{'date=foo|lang=nn|era=AD', 'foo e.Kr.'},
{'date=foo|lang=no|era=AD', 'foo e.Kr.'},
{'date=foo|lang=pl|era=AD', 'foo [[:pl:naszej ery|n.e.]]'},
{'date=foo|lang=ro|era=AD', 'foo d.Hr.'},
{'date=foo|lang=ru|era=AD', 'foo н. э.'},
{'date=foo|lang=sl|era=AD', 'foo n. št.'},
{'date=foo|lang=sv|era=AD', 'foo [[:sv:Efter Kristus|e.Kr.]]'},
{'date=foo|lang=vi|era=AD', 'foo [[:vi:Công Nguyên|CN]]'},
{'date=foo|lang=zh|era=AD', '公元foo'},
})
end
function p:test_AH()
self:preprocess_equals_many('{{#invoke:Era|era|','}}', {
{'date=foo|lang=bn|era=AH', 'foo [[:bn:ইসলামি বর্ষপঞ্জি|হিজরী]]'},
{'date=foo|lang=en|era=AH', 'foo [[:en:Hijri year|AH]]'},
{'date=foo|lang=fa|era=AH', 'foo ه.ق.'},
{'date=foo|lang=fr|era=AH', 'foo [[:fr:Calendrier musulman|A.H.]]'},
{'date=foo|lang=pl|era=AH', 'foo [[:pl:Kalendarz muzułmański|A.H.]]'},
{'date=foo|lang=ru|era=AH', 'foo [[:ru:Исламский календарь|хиджры]]'},
{'date=foo|lang=sv|era=AH', 'foo [[:sv:Muslimska kalendern|A.H.]]'},
{'date=foo|lang=vi|era=AH', 'foo [[:vi:Lịch Hồi giáo|AH]]'},
})
end
function p:test_BC()
self:preprocess_equals_many('{{#invoke:Era|era|','}}', {
{'date=foo|lang=ar|era=BC', 'foo ق.م.'},
{'date=foo|lang=bn|era=BC', 'foo খ্রিস্টপূর্ব'},
{'date=foo|lang=ca|era=BC', 'foo [[:ca:Abans de Crist|aC]]'},
{'date=foo|lang=cs|era=BC', 'foo [[:cs:Př. n. l.|př. n. l.]]'},
{'date=foo|lang=de|era=BC', 'foo v. Chr.'},
{'date=foo|lang=el|era=BC', 'foo π.Χ.'},
{'date=foo|lang=en|era=BC', 'foo [[:en:Ante Christum Natum|BC]]'},
{'date=foo|lang=es|era=BC', 'foo [[:es:Antes de Cristo|a.C.]]'},
{'date=foo|lang=fa|era=BC', 'foo پ.م.'},
{'date=foo|lang=fi|era=BC', 'foo eaa.'},
{'date=foo|lang=fr|era=BC', 'foo av. J.-C.'},
{'date=foo|lang=gl|era=BC', 'foo [[:gl:Antes de Cristo|a.C.]]'},
{'date=foo|lang=he|era=BC', 'foo לפני הספירה'},
{'date=foo|lang=it|era=BC', 'foo [[:it:Avanti Cristo|a.C.]]'},
{'date=foo|lang=ja|era=BC', '紀元前foo'},
{'date=foo|lang=mk|era=BC', 'foo п.н.е.'},
{'date=foo|lang=ml|era=BC', 'ക്രി.മു. foo'},
{'date=foo|lang=nds|era=BC', 'foo vör uns Tied'},
{'date=foo|lang=nds|era=BC', 'foo vör uns Tied'},
{'date=foo|lang=nl|era=BC', 'foo v.Chr.'},
{'date=foo|lang=nn|era=BC', 'foo f.Kr.'},
{'date=foo|lang=no|era=BC', 'foo f.Kr.'},
{'date=foo|lang=pl|era=BC', 'foo [[:pl:przed naszą erą|p.n.e.]]'},
{'date=foo|lang=ro|era=BC', 'foo î.Hr.'},
{'date=foo|lang=ru|era=BC', 'foo до н. э.'},
{'date=foo|lang=sl|era=BC', 'foo pr. n. št.'},
{'date=foo|lang=sv|era=BC', 'foo [[:sv:Före Kristus|f.Kr.]]'},
{'date=foo|lang=vi|era=BC', 'foo [[:vi:Trước Công Nguyên|TCN]]'},
{'date=foo|lang=zh|era=BC', '前foo'},
})
end
function p:test_BP()
self:preprocess_equals_many('{{#invoke:Era|era|','}}', {
{'date=foo|lang=ar|era=BP', 'foo [[:ar:قبل الحاضر|قبل الحاضر]]'},
{'date=foo|lang=be|era=BP', 'foo [[:be-x-old:Да нашых дзён|Да нашых дзён]]'},
{'date=foo|lang=bn|era=BP', 'বর্তমানের আগে foo'},
{'date=foo|lang=ca|era=BP', 'foo [[:ca:BP (unitat de temps)|BP]]'},
{'date=foo|lang=cs|era=BP', 'foo [[:cs:B. P.|B. P.]]'},
{'date=foo|lang=de|era=BP', 'foo [[:de:Before Present|BP]]'},
{'date=foo|lang=el|era=BP', 'foo [[:en:Before Present|BP]]'},
{'date=foo|lang=en|era=BP', 'foo [[:en:Before Present|BP]]'},
{'date=foo|lang=es|era=BP', 'foo [[:es:Before Present|BP]]'},
{'date=foo|lang=et|era=BP', 'foo [[:et:Before Present|BP]]'},
{'date=foo|lang=fa|era=BP', 'foo پیش از اکنون'},
{'date=foo|lang=fi|era=BP', 'foo [[:fi:BP (ajanlasku)|BP]]'},
{'date=foo|lang=fr|era=BP', 'foo [[:fr:Avant le présent|avant le présent]]'},
{'date=foo|lang=it|era=BP', 'foo [[:it:Before Present|BP]]'},
{'date=foo|lang=ja|era=BP', 'foo [[:ja:BP (年代測定)|BP]]'},
{'date=foo|lang=lv|era=BP', 'foo [[:lv:Pirms mūsdienām|Pirms mūsdienām]]'},
{'date=foo|lang=mk|era=BP', 'foo [[:mk:Пред сегашноста|п.с.]]'},
{'date=foo|lang=ml|era=BP', '[[:en:Before Present|ഇന്നത്തെ കാലത്തിനു മുമ്പ്]] foo'},
{'date=foo|lang=nl|era=BP', 'foo [[:nl:Before Present|BP]]'},
{'date=foo|lang=no|era=BP', 'foo [[:no:Before Present|BP]]'},
{'date=foo|lang=pl|era=BP', 'foo [[:pl:Before Present|BP]]'},
{'date=foo|lang=pt|era=BP', 'foo [[:pt:Antes do Presente|Antes do Presente]]'},
{'date=foo|lang=ru|era=BP', 'foo [[:ru:До настоящего времени|до н. в.]]'},
{'date=foo|lang=sk|era=BP', 'foo [[:sk:Before Present|BP]]'},
{'date=foo|lang=sl|era=BP', 'foo [[:sl:pred sedanjostjo|p. s.]]'},
{'date=foo|lang=sr|era=BP', 'foo [[:sr:Прије садашњости|Прије садашњости]]'},
{'date=foo|lang=sv|era=BP', 'foo [[:sv:B.P.|B.P.]]'},
{'date=foo|lang=uk|era=BP', 'foo [[:uk:Років тому|Років тому]]'},
{'date=foo|lang=vi|era=BP', 'foo [[:en:Before Present|trước ngày nay]]'},
{'date=foo|lang=zh|era=BP', '距今foo'},
})
end
return p