Module:TFA title/testcases

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

function p:test()
	self:equals_deep("Title on 2004-02-22", tfa.title("2004-02-22"), 'Wolfgang Amadeus Mozart')
	self:equals_deep("Titles on 2008-11-04", tfa.title("2008-11-04"), {"John McCain", "Barack Obama"})
	self:equals_deep("Titles on 3000-01-01", tfa.title("3000-01-01"), nil)

	self:equals_deep("Is TFA on 2004-02-22 - correct", tfa.is_tfa_on("Wolfgang Amadeus Mozart", "2004-02-22"), "yes")
	self:equals_deep("Is TFA on 2004-02-22 - wrong", tfa.is_tfa_on("Main Page", "2004-02-22"), "")
	self:equals_deep("Is TFA on 2008-11-04 - correct", tfa.is_tfa_on("John McCain", "2008-11-04"), "yes")
	self:equals_deep("Is TFA on 2008-11-04 - correct", tfa.is_tfa_on("Barack Obama", "2008-11-04"), "yes")
	self:equals_deep("Is TFA on 2008-11-04 - wrong", tfa.is_tfa_on("Main Page", "2008-11-04"), "")
	self:equals_deep("Is TFA on 3000-01-01 - no data", tfa.is_tfa_on("Main Page", "3000-01-01"), "")


end

return p

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.