Module:Footnotes/testcases: Difference between revisions

Content deleted Content added
No edit summary
drop nowiki
 
(5 intermediate revisions by 4 users not shown)
Line 1:
-- Unit tests for [[Module:CitationFootnotes]]. Click talk page to run tests.
local p = require('Module:UnitTests')
 
Line 24:
{ " Smith|2011|loc=[http://en.wikipedia.org chpt 3]" },
{ " 中国 | चीन | 2004" },
{ " aiguë | Dütschlünd | 2004" },
} )
end
 
function p:test_sfn()
self:preprocess_equals_preprocess_many('{{sfn/sandbox|', '}}', '{{sfn|', '}}', {
{""},
{ "Smith | 2004" },
{ "Smith | Jones | 2004" },
{ "Smith | Jones | Brown | 2004" },
{ "Smith | Jones | Brown | Taylor | 2004" },
{ "Smith | Jones | Brown | Taylor | King | 2004" },
{ "Smith | Jones | 2004 | p=45" },
{ "Smith | Jones | 2004 | page=45" },
{ "Smith | Jones | 2004 | p=45 | page =46" },
{ "Smith | Jones | 2004 | pp=23-57" },
{ "Smith | Jones | 2004 | pages=45-78" },
{ "Smith | Jones | 2004 | pp=23-57 | pages=45-78" },
{ "Smith | Jones | 2004 | pp=23-57 | loc=45-78" },
{ "Smith | Jones | 2004 | p=23 | loc=45-78" },
{ "Smith | Jones | 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| ___location=145-178" },
{ "Smith | Jones | 2004 | loc=Chapter 2" },
{ "Smith | Jones | Brown | 2004 | ref = none" },
{ "Smith | Jones | Brown | 2004 | ref = Cream cheese" },
{ " Smith|2011|loc=[http://en.wikipedia.org chpt 3]" },
{ " 中国 | चीन | 2004" },
{ " aiguë | Dütschlünd | 2004" },
})
end
 
 
function p:test_harv()
Line 50 ⟶ 78:
{ " Smith|2011|loc=[http://en.wikipedia.org chpt 3]" },
{ " 中国 | चीन | 2004" },
{ " aiguë | Dütschlünd | 2004" },
} )
end
 
function p:test_harvard_core()
if nil then
self:preprocess_equals_preprocess_many('{{harvard citation/core/sandbox|', '}}', '{{harvard citation/core|', '}}', {
{ "" },
Line 72 ⟶ 102:
{ "P1 = Smith | P2 = Jones | P3 = 2004 | REF = ABC | BracketRight=% | BracketLeft=_ | BracketYearRight=@ | BracketYearLeft=^ | Postscript = ..." },
} )
end
end