Mô đun:Webarchive/testcases

local p = require('Module:UnitTests')

function p:test_Usage_Examples()
self:preprocess_equals_preprocess_many(, , {
{'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016'},
{'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/ |date=12 February 2009'},
{'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/ |date=12 February 2009 |title=Page title'}
} )
end

function p:test_Template_Examples()
self:preprocess_equals_preprocess_many(, , {
{'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016 |title=Page title'},
{'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016'},
{'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/'},
{'|url=https://web.archive.org/web/20160801/http://example.com |title=Page title |date=August 1, 2016 |url2=https://web.archive.org/web/20160901/http://example.com |title2=Page2 title |date2=September 1, 2016'},
{'|url=https://web.archive.org/web/20160801/http://example.com |date=August 1, 2016 |url2=https://web.archive.org/web/20160901/http://example.com |date2=September 1, 2016'},
{'|url=https://web.archive.org/web/20160801/http://example.com |title=Page title |url2=https://web.archive.org/web/20160901/http://example.com |title2=Page2 title'},
})
end

function p:test_Permacc()
self:preprocess_equals_preprocess_many(, , {
{'|url=http://perma.cc/F9NT-22AK |date=2015-04-09'},
{'|url=http://perma.cc/F9NT-22AK |date=2015-04-09 |title=Mike Pressler Biography'},
} )
end

function p:test_z1_notdate_archiveis()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_archiveis1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_archiveis2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_wayback()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_wayback_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_webarchiveloc()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_webcite()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_archiveit1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_archiveit2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z2_missingdate_archiveit3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_archiveis1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_archiveis2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_wayback()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_wayback_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_webarchiveloc()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_webcite()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_archiveit1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_archiveit2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z3_wrongdate_archiveit3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_wayback()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_webarchiveloc()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_archiveit1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_archiveit2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z4_index_archiveit3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_archiveis1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_archiveis2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_wayback()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_wayback_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_webarchiveloc()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_webcite()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_archiveit1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_archiveit2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z5_mdy_archiveit3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_archiveis1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_archiveis2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_wayback()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_wayback_ukgwa()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_webarchiveloc()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_webcite()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_archiveit1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_archiveit2()
self:preprocess_equals_preprocess(
,

)
end

function p:test_z6_dmy_archiveit3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlarchives_1()
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlarchives_2() -- has malformed |date2=
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlarchives_3()
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlpages_1() -- without title
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlpages_2() -- uses title
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlpages_3() -- uses title (Title 1) and not title (page 2)
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlpages_4()
self:preprocess_equals_preprocess(
,

)
end

function p:test_addlpages_5()
self:preprocess_equals_preprocess(
,

)
end

function p:test_sequencegap()
self:preprocess_equals_preprocess(
,

)
end

return p