Module:Citation/CS1/testcases

This is an old revision of this page, as edited by Dragons flight (talk | contribs) at 22:49, 20 March 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Unit tests for [[Module:Citation/CS1]]. Click talk page to run tests.
local p = require('Module:UnitTests')
 
function p:test_encyclopedia()
    self:preprocess_equals_preprocess_many('{{cite web/lua|', '}}', '{{cite web/new|', '}}', {
       { [[
|last= LAST
|first= FIRST
|authorlink= AUTHORLINK
|editor-first= EDITOR-FIRST
|editor-last= EDITOR-LAST
|editor-link= EDITOR-LINK
|encyclopedia= ENCYCLOPEDIA
|title= TITLE
|trans_title= TRANS_TITLE
|url= URL
|accessdate= ACCESSDATE
|language= LANGUAGE
|edition= EDITION
|date= DATE
|year= YEAR
|month= MONTH
|publisher= PUBLISHER 
|volume= VOLUME
|___location= LOCATION
|id= ID
|isbn= ISBN
|oclc= OCLC
|doi= 10.DOI
|pages= PAGES
|quote= QUOTE
|ref= REF]]
 }
    }, {nowiki=false})
end

function p:test_news()
    self:preprocess_equals_preprocess_many('{{cite web/lua|', '}}', '{{cite web/new|', '}}', {
       { 'url=http://www.foo.com/ | title = Bob', 'url=http://www.foo.com/ | title = Bob' }
    }, {nowiki=false})
end
 
function p:test_web()
    self:preprocess_equals_preprocess_many('{{cite web/lua|', '}}', '{{cite web/new|', '}}', {
       { 'url=http://www.foo.com/ | title = Bob', 'url=http://www.foo.com/ | title = Bob' }
    }, {nowiki=false})
end

return p