Module:Webarchive/sandbox/testcases

local p = require('Module:UnitTests')

function p:test_Usage_Examples self:preprocess_equals_many('', {		 {'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016', 'Archived August 1, 2016, at the Wayback Machine.'},		 {'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/ |date=12 February 2009', 'Archived 12 February 2009 at WebCite'},		 {'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/ |date=12 February 2009 |title=Page title', 'Page title at WebCite&#32;(archived 12 February 2009)'},	} ) end

function p:test_Template_Examples self:preprocess_equals_many('', {		 {'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016 |title=Page title',		 	'Page title at the Wayback Machine&#32;(archived August 1, 2016)'},		 {'|url=https://web.archive.org/web/20160801000000/http://example.com |date=August 1, 2016',		 	'Archived August 1, 2016, at the Wayback Machine.'},		 {'|url=http://www.webcitation.org/5eWaHRbn4?url=http://www.example.com/',		 	'Archived 2009-02-12 at WebCite'},		 {'|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', 'Page title at the Wayback Machine&#32;(archived August 1, 2016). Additional archives: Page2 title.'}, {'|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', 'Archived August 1, 2016, at the Wayback Machine. Additional archives: 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', 'Page title at the Wayback Machine&#32;(archived 2016-08-01). Additional archives: Page2 title.'}, } ) end

function p:test_Permacc self:preprocess_equals_many('', {		 {'|url=http://perma.cc/F9NT-22AK |date=2015-04-09', 'Archived 2015-04-09 at Perma.cc'},		 {'|url=http://perma.cc/F9NT-22AK |date=2015-04-09 |title=Mike Pressler Biography', 'Mike Pressler Biography at Perma.cc&#32;(archived 2015-04-09)'},	} ) end

return p