Module:Vital article/testcases
| This is the test cases page for the module Module:Vital article. Results of the test cases. |
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local test_link_cases = {
{'|page=philosophy', '<span>[[:Philosophy|Philosophy]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/1|1]]'},
{'|page=Calamotropha punctivenellus', '<span>[[:Calamotropha punctivenellus|Calamotropha punctivenellus]] </span>[[File:Escape suspect.svg|11px|Non-vital article]]'},
{'|page=non-article', '<span>[[:Non-article|Non-article]] </span>[[File:Escape suspect.svg|11px|Non-vital article]]'},
{'|page=Philosophy', '<span>[[:Philosophy|Philosophy]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/1|1]]'},
{'|page=Food', '<span>[[:Food|Food]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/2#Everyday life|2]]'},
{'|page=Euclid', '<span>[[:Euclid|Euclid]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/3#Mathematicians|3]]'},
{'|page=Statue of Liberty', '<span>[[:Statue of Liberty|Statue of Liberty]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/4/Arts#Specific structures|4]]'},
{'|page=Cratonic sequence', '<span>[[:Cratonic sequence|Cratonic sequence]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/5/Physical sciences/Earth science#Stratigraphy|5]]'},
{'|page=Infinity', '<span>[[:Infinity|Infinity]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/3#Analysis|3]]'},
{'|page=1', '<span>[[:1|1]] </span>[[File:Círculos Concéntricos.svg|11px|Vital article]] [[Wikipedia:Vital articles/Level/4/Mathematics#Basics|4]]'}
}
local test_level_cases = {
['Philosophy'] = 1,
['Astronomy'] = 2,
['Homer'] = 3,
['Thallophyca'] = 0,
['non-article'] = 0,
['0'] = 3,
['1'] = 4,
['2666'] = 5,
}
-- Example unit test.
function p:test_link()
self:preprocess_equals_sandbox_many('{{#invoke:Vital article', 'link', test_link_cases)
end
--function p:test_levels()
-- for k, v in pairs(test_level_cases) do
-- self:preprocess_equals(
-- '{{#invoke:Vital article/sandbox|getLevel|page=' .. k .. '}}', tostring(v))
-- end
--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.
- 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:
- 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.
- 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.
- 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.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.