Difference between revisions of "Module:Footnotes/testcases"
Jump to navigation
Jump to search
test>Dragons flight |
test>Dragons flight |
||
| Line 53: | Line 53: | ||
{ "Smith | Jones | Brown | 2004 | ref = Cream cheese" }, | { "Smith | Jones | Brown | 2004 | ref = Cream cheese" }, | ||
{ " Smith|2011|loc=[http://en.wikipedia.org chpt 3]" }, | { " Smith|2011|loc=[http://en.wikipedia.org chpt 3]" }, | ||
| + | } ) | ||
| + | end | ||
| + | |||
| + | function p:test_harvard_core() | ||
| + | self:preprocess_equals_preprocess_many('{{harvard citation/core/sandbox|', '}}', '{{harvard citation/core|', '}}', { | ||
| + | { "P1 = Smith | P2 = 2004" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = 2004" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = King | P6 = 2004" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | p=45" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | page=45" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | p=45 | page =46" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | pages=45-78" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57 | pages=45-78" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57 | location=45-78" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | p=23 | location=45-78" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| location=145-178" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = 2004 | loc=Chapter 2" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004 | REF = none" }, | ||
| + | { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004 | REF = Cream cheese" }, | ||
| + | { "P1=Smith| P2 = 2011 | loc=[http://en.wikipedia.org chpt 3]" }, | ||
} ) | } ) | ||
end | end | ||
return p; | return p; | ||
Revision as of 17:36, 31 March 2013
Documentation for this module may be created at Module:Footnotes/testcases/doc
-- Unit tests for [[Module:Citation]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_sfn()
self:preprocess_equals_preprocess_many('{{sfn/sandbox|', '}}', '{{sfn|', '}}', {
{ "Smith | Jones | 2004"
}
}, {nowiki=true} )
end
function p:test_harvnb()
self:preprocess_equals_preprocess_many('{{harvard citation no brackets/sandbox|', '}}', '{{harvnb|', '}}', {
{ "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 | location=45-78" },
{ "Smith | Jones | 2004 | p=23 | location=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]" },
} )
end
function p:test_harv()
self:preprocess_equals_preprocess_many('{{harvard citation/sandbox|', '}}', '{{harv|', '}}', {
{ "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 | location=45-78" },
{ "Smith | Jones | 2004 | p=23 | location=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]" },
} )
end
function p:test_harvard_core()
self:preprocess_equals_preprocess_many('{{harvard citation/core/sandbox|', '}}', '{{harvard citation/core|', '}}', {
{ "P1 = Smith | P2 = 2004" },
{ "P1 = Smith | P2 = Jones | P3 = 2004" },
{ "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004" },
{ "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = 2004" },
{ "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = King | P6 = 2004" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | p=45" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | page=45" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | p=45 | page =46" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | pages=45-78" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57 | pages=45-78" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | pp=23-57 | location=45-78" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | p=23 | location=45-78" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| location=145-178" },
{ "P1 = Smith | P2 = Jones | P3 = 2004 | loc=Chapter 2" },
{ "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004 | REF = none" },
{ "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004 | REF = Cream cheese" },
{ "P1=Smith| P2 = 2011 | loc=[http://en.wikipedia.org chpt 3]" },
} )
end
return p;