模組:Footnotes/testcases

Chhiùng Wikipedia lòi

64 tests failed.

test_harv
Text Expected Actual
模板:Cross {{harvard citation|}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | Brown | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | Brown | Taylor | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | Brown | Taylor | King | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | p=45}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | page=45}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | p=45 | page =46}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | pp=23-57}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith|2006| pp=25–26 | Ref=none}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | pages=45-78}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | pp=23-57 | pages=45-78}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | pp=23-57 | loc=45-78}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | p=23 | loc=45-78}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| location=145-178}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | 2004 | loc=Chapter 2}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | Brown | 2004 | ref = none}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation|Smith | Jones | Brown | 2004 | ref = Cream cheese}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation| Smith|2011|loc=[http://en.wikipedia.org chpt 3]}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation| 中国 | चीन | 2004}} 模板:Harv 模板:Harvard citation
模板:Cross {{harvard citation| aiguë | Dütschlünd | 2004}} 模板:Harv 模板:Harvard citation
test_harvard_core
Text Expected Actual
test_harvnb
Text Expected Actual
模板:Cross {{harvard citation no brackets|}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | Brown | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | Brown | Taylor | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | Brown | Taylor | King | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | p=45}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | page=45}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | p=45 | page =46}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | pp=23-57}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | pages=45-78}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | pp=23-57 | pages=45-78}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | pp=23-57 | loc=45-78}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | p=23 | loc=45-78}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| location=145-178}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | 2004 | loc=Chapter 2}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | Brown | 2004 | ref = none}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets|Smith | Jones | Brown | 2004 | ref = Cream cheese}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets| Smith|2011|loc=[http://en.wikipedia.org chpt 3]}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets| 中国 | चीन | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
模板:Cross {{harvard citation no brackets| aiguë | Dütschlünd | 2004}} 模板:Harvnb 模板:Harvard citation no brackets
test_sfn
Text Expected Actual
模板:Cross {{sfn|}} [1] [1]
模板:Cross {{sfn|Smith | 2004}} [2] [2]
模板:Cross {{sfn|Smith | Jones | 2004}} [3] [3]
模板:Cross {{sfn|Smith | Jones | Brown | 2004}} [4] [4]
模板:Cross {{sfn|Smith | Jones | Brown | Taylor | 2004}} [5] [5]
模板:Cross {{sfn|Smith | Jones | Brown | Taylor | King | 2004}} [6] [6]
模板:Cross {{sfn|Smith | Jones | 2004 | p=45}} [7] [7]
模板:Cross {{sfn|Smith | Jones | 2004 | page=45}} [7] [7]
模板:Cross {{sfn|Smith | Jones | 2004 | p=45 | page =46}} [7] [7]
模板:Cross {{sfn|Smith | Jones | 2004 | pp=23-57}} [8] [8]
模板:Cross {{sfn|Smith | Jones | 2004 | pages=45-78}} [9] [9]
模板:Cross {{sfn|Smith | Jones | 2004 | pp=23-57 | pages=45-78}} [8] [8]
模板:Cross {{sfn|Smith | Jones | 2004 | pp=23-57 | loc=45-78}} [10] [10]
模板:Cross {{sfn|Smith | Jones | 2004 | p=23 | loc=45-78}} [11] [11]
模板:Cross {{sfn|Smith | Jones | 2004 | p=23 | page=45 | pp=23-57 | pages=45-78| location=145-178}} [12] [12]
模板:Cross {{sfn|Smith | Jones | 2004 | loc=Chapter 2}} [13] [13]
模板:Cross {{sfn|Smith | Jones | Brown | 2004 | ref = none}} [4] [4]
模板:Cross {{sfn|Smith | Jones | Brown | 2004 | ref = Cream cheese}} [4] [4]
模板:Cross {{sfn| Smith|2011|loc=[http://en.wikipedia.org chpt 3]}} [14] [14]
模板:Cross {{sfn| 中国 | चीन | 2004}} [15] [15]
模板:Cross {{sfn| aiguë | Dütschlünd | 2004}} [16] [16]


  1. 1.0 1.1 [[#CITEREF|]].
  2. 2.0 2.1 Smith 2004.
  3. 3.0 3.1 Smith & Jones 2004.
  4. 4.0 4.1 4.2 4.3 4.4 4.5 Smith, Jones & Brown 2004. Yín-yung chhâ-chho: 無效的<ref>標籤;name屬性“FOOTNOTESmithJonesBrown2004”使用不同內容定義了多次
  5. 5.0 5.1 Smith et al. 2004.
  6. 6.0 6.1 Smith et al. King.
  7. 7.0 7.1 7.2 7.3 7.4 7.5 Smith & Jones 2004, p. 45.
  8. 8.0 8.1 8.2 8.3 Smith & Jones 2004, pp. 23-57.
  9. 9.0 9.1 Smith & Jones 2004, pp. 45-78.
  10. 10.0 10.1 Smith & Jones 2004, pp. 23-57, 45-78.
  11. 11.0 11.1 Smith & Jones 2004, p. 23, 45-78.
  12. 12.0 12.1 Smith & Jones 2004, p. 23.
  13. 13.0 13.1 Smith & Jones 2004, Chapter 2.
  14. 14.0 14.1 Smith 2011, chpt 3.
  15. 15.0 15.1 中国 & चीन 2004.
  16. 16.0 16.1 aiguë & Dütschlünd 2004.

-- Unit tests for [[Module:Citation]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_harvnb()
    self:preprocess_equals_preprocess_many('{{harvard citation no brackets|', '}}', '{{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 | 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_sfn()
    self:preprocess_equals_preprocess_many('{{sfn|', '}}', '{{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()
    self:preprocess_equals_preprocess_many('{{harvard citation|', '}}', '{{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|2006| pp=25–26 | Ref=none" },
        { "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_harvard_core()
	if nil then
    self:preprocess_equals_preprocess_many('{{harvard citation/core|', '}}', '{{harvard citation/core|', '}}', {
        { "" },
        { "P1 = Smith | P2 = 2004 | REF = ABC" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | REF = ABC" },
        { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = 2004 | REF = ABC" },
        { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = 2004 | REF=ABC" },
        { "P1 = Smith | P2 = Jones | P3 = Brown | P4 = Taylor | P5 = King | P6 = 2004 | REF=ABC" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Page=45 | REF=ABC | PageSep=, p.&nbsp;" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Pages=23-57| REF = ABC | PagesSep=, pp.&nbsp;" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Location=45-78 | REF = ABC" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Page=23 | Location=45-78 | REF= ABC | PageSep=, p.&nbsp;" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Page=45 | Pages=45-78| Location=145-178 | REF = ABC| PageSep=, p.&nbsp;| PagesSep=, pp.&nbsp;" },
        { "P1 = Smith | P2 = Jones | P3 = 2004 | Location=Chapter 2 | REF = ABC" },
        { "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 | Location=[http://en.wikipedia.org chpt 3] | REF=ABC" },        
        { "P1 = Smith | P2 = Jones | P3 = 2004 | REF = ABC | BracketRight=% | BracketLeft=_ | BracketYearRight=@ | BracketYearLeft=^ | Postscript = ..." },
    } )
    end
end

return p;