Mô đun:Các thông báo sửa đổi Không gian tên Chính/testcases
Giao diện
| Đây là trang kiểm thử mô đun Mô đun:Các thông báo sửa đổi Không gian tên Chính. Xem các kết quả kiểm thử. |
-- Unit tests for [[Module:Mainspace editnotice]]. Click talk page to run tests.-- local TfaTitle = require('Module:TFA title')local ScribuntoUnit = require('Module:ScribuntoUnit')local suite = ScribuntoUnit:new()function suite:assertNoticeEquals(page, notice) self:assertEquals( mw.text.killMarkers(suite.frame:preprocess(notice)), mw.text.killMarkers(suite.frame:preprocess( '{{#invoke:Mainspace editnotice|main|page='..page..'}}')) )endfunction suite:testBlp() -- In [[Category:Living people]] self:assertNoticeEquals('Barack Obama', '{{BLP editintro}}') -- In [[Category:Possibly living people]] self:assertNoticeEquals('Earl Ashby', '{{BLP editintro}}')endfunction suite:testDisambig() self:assertNoticeEquals('1998 hurricane season', '{{Disambig editintro}}') self:assertNoticeEquals('M31', '{{Disambig editintro}}')endfunction suite:testRefideas() self:assertNoticeEquals('Mobile Suit Victory Gundam', '{{Refideas editnotice}}')end-- function suite:testTfa()-- self:assertNoticeEquals(TfaTitle.today_title(), '{{TFA editnotice}}')-- endfunction suite:testDraft() -- Disambig page having a draft page self:assertNoticeEquals('Example', '{{Disambig editintro}}{{Draft at}}')endreturn suite