<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ALDSverse%2Ftestcases</id>
	<title>Module:LDSverse/testcases - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ALDSverse%2Ftestcases"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:LDSverse/testcases&amp;action=history"/>
	<updated>2026-05-28T21:37:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:LDSverse/testcases&amp;diff=137127&amp;oldid=prev</id>
		<title>imported&gt;Biggins: Fixed typo</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:LDSverse/testcases&amp;diff=137127&amp;oldid=prev"/>
		<updated>2020-08-28T09:49:21Z</updated>

		<summary type="html">&lt;p&gt;Fixed typo&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Unit tests for [[Module:LDSVerse]]. Click talk page to run tests.&lt;br /&gt;
&lt;br /&gt;
-- NB: If you ever see a failure on the results page even though the text seems like it&amp;#039;s&lt;br /&gt;
--	*exactly* the same as what was expected but it still tells you there&amp;#039;s a &lt;br /&gt;
--	difference, check the underscore situation. The LDSverse module does not use &lt;br /&gt;
--	underscores between words when generating the cross-wiki link (except for in &lt;br /&gt;
--	#bookmarks, where they are required for the bookmark to work) so if the &lt;br /&gt;
--	test case here expects there to be underscores in the generated link (e.g., &lt;br /&gt;
--	[[s:Bible_(King_James)/Genesis|Gen.]]) it will throw an error because the &lt;br /&gt;
--	link generated by the module will just be [[s:Bible (King James)/Genesis|Gen.]].&lt;br /&gt;
--	This is really annoying to debug because by the time MediaWiki generates the &lt;br /&gt;
--	HTML that you see on the results page, it has in fact swapped in underscores &lt;br /&gt;
--	for those spaces! But that is what is going on. FYI :)&lt;br /&gt;
&lt;br /&gt;
local p = require(&amp;#039;Module:UnitTests&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
-- No parameters unit test&lt;br /&gt;
function p:test_01_noParams()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS}}&amp;#039;, &amp;#039;[[s:Portal:Mormonism#LDS_Standard_Works_(Scriptures)|LDS Standard Works]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- One parameter&lt;br /&gt;
function p:test_02_noParams2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Display Text}}&amp;#039;, &amp;#039;[[s:Portal:Mormonism#LDS_Standard_Works_(Scriptures)|Display Text]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to book in Bible&lt;br /&gt;
function p:test_03_genesis()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Gen.|gen}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Genesis|Gen.]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to (other) book in Bible #1&lt;br /&gt;
function p:test_04_sos1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|The Songs of Solomon|song}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Song of Solomon|The Songs of Solomon]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to (other) book in Bible #2&lt;br /&gt;
function p:test_05_sos2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Canticles|Song of Solomon}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Song of Solomon|Canticles]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to Bible chapter #1&lt;br /&gt;
function p:test_06_num_3()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Num.|num|3}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Numbers#chapter_3|Num. 3]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to Bible chapter #2&lt;br /&gt;
function p:test_07_1_kings_5()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|1 Kuningad|1kgs|5}}&amp;#039;, &amp;#039;[[s:Bible (King James)/1 Kings#chapter_5|1 Kuningad 5]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to Bible chapter #3&lt;br /&gt;
function p:test_08_amos_2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Amos (not Andy)|Amos|2}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Amos#chapter_2|Amos (not Andy) 2]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to Bible verse #1&lt;br /&gt;
function p:test_09_gen_3_6()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Gen.|gen|3|6}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Genesis#3:6|Gen. 3:6]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to Bible verse #2&lt;br /&gt;
function p:test_10_matt_5_20()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Matt.|Matthew|5|20}}&amp;#039;, &amp;#039;[[s:Bible (King James)/Matthew#5:20|Matt. 5:20]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM book #1&lt;br /&gt;
function p:test_11_mormon()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Morm.|Mormon}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Mormon|Morm.]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM book #2&lt;br /&gt;
function p:test_12_enos()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Enos da Man|Enos}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Enos|Enos da Man]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM book #3&lt;br /&gt;
function p:test_13_1_ne()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Morm.|1 Nephi}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/1 Nephi|Morm.]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM chapter #1&lt;br /&gt;
function p:test_14_2_ne_26()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|2 Nyafi|2 Nephi|26}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/2 Nephi#chapter_26|2 Nyafi 26]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM chapter #2&lt;br /&gt;
function p:test_15_alma_50()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Alma|alma|50}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Alma#chapter_50|Alma 50]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to BoM verse #1&lt;br /&gt;
function p:test_16_2_ne_26_33()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|2 Nyafi|2 Nephi|26|33}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/2 Nephi#26:33|2 Nyafi 26:33]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to D&amp;amp;C&lt;br /&gt;
function p:test_17_dc()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|D&amp;amp;C|dc}}&amp;#039;, &amp;#039;[[s:The Doctrine and Covenants|D&amp;amp;C]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to D&amp;amp;C Section&lt;br /&gt;
function p:test_18_dc_88()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|D&amp;amp;C|dc|88}}&amp;#039;, &amp;#039;[[s:The Doctrine and Covenants/Section 88|D&amp;amp;C 88]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to D&amp;amp;C verse&lt;br /&gt;
function p:test_19_dc_88_6()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|D&amp;amp;C|dc|88|6}}&amp;#039;, &amp;#039;[[s:The Doctrine and Covenants/Section 88#6|D&amp;amp;C 88:6]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP book 1&lt;br /&gt;
function p:test_20_jst_matthew()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JST Matthew|jst-matt}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Matthew|JST Matthew]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP book 2&lt;br /&gt;
function p:test_21_abraham()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Avraham (Gileadi)|abr}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Abraham|Avraham (Gileadi)]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP book 3&lt;br /&gt;
function p:test_22_moses()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Moses|moses}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Moses|Moses]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP book 4&lt;br /&gt;
function p:test_23_history()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JS History|History}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/History|JS History]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP book 5&lt;br /&gt;
function p:test_24_aof()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|AoF|aoff}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Articles of Faith|AoF]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP chapter 1&lt;br /&gt;
function p:test_25_moses_2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Moses|moses|2}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Moses#chapter_2|Moses 2]]&amp;#039;) -- This assumes that PoGP chapter bookmarks get standardized&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP chapter 2&lt;br /&gt;
function p:test_26_abraham_3()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Abr.|Abraham|3}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Abraham#chapter_3|Abr. 3]]&amp;#039;) -- This assumes that PoGP chapter bookmarks get standardized&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP chapter 3&lt;br /&gt;
function p:test_27_aof_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|AoF|aoff|1}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Articles of Faith#chapter_1|AoF 1]]&amp;#039;) -- This assumes that PoGP chapter bookmarks get standardized&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP chapter 4&lt;br /&gt;
function p:test_28_jst_matthew_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JS Matthew|jsm|1}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Matthew#chapter_1|JS Matthew 1]]&amp;#039;) -- This assumes that PoGP chapter bookmarks get standardized&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP chapter 5&lt;br /&gt;
function p:test_29_js_history_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JS Hist.|jsh|1}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/History#chapter_1|JS Hist. 1]]&amp;#039;) -- This assumes that PoGP chapter bookmarks get standardized&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP verse 1&lt;br /&gt;
function p:test_30_moses_3_8()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Moses|moses|3|8}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Moses#3:8|Moses 3:8]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP verse 2&lt;br /&gt;
function p:test_31_abraham_3_8()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Abr.|Abraham|3|8}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Abraham#3:8|Abr. 3:8]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP verse 3&lt;br /&gt;
function p:test_32_jst_matthew_26()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JST Matthew|jst-matt|1|26}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Matthew#1:26|JST Matthew 1:26]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP verse 4&lt;br /&gt;
function p:test_33_jst_hist_16()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|JST Historia|js-hist|1|16}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/History#1:16|JST Historia 1:16]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Cite to PoGP verse 5&lt;br /&gt;
function p:test_34_aof_11()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Articles o\&amp;#039; Faith|Articles of Faith|1|11}}&amp;#039;, &amp;#039;[[s:The Pearl of Great Price (1913)/Articles of Faith#1:11|Articles o\&amp;#039; Faith 1:11]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- weird spacing issues&lt;br /&gt;
function p:test_35_spacing_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS |Alma |alma |7 |11 }}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Alma#7:11|Alma 7:11]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- weird spacing issues&lt;br /&gt;
function p:test_36_spacing_2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS |  Mos. | mosiah |  4 |  16 }}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Mosiah#4:16|Mos. 4:16]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- range of verses&lt;br /&gt;
function p:test_37_range_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Doctrine + Covenants|dc|128|19|22}}&amp;#039;, &amp;#039;[[s:The Doctrine and Covenants/Section 128#19|Doctrine + Covenants 128:19–22]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- range of verses&lt;br /&gt;
function p:test_38_range_2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Doctrine + Covenants|dc|128|19|–22, 24|||x}}&amp;#039;, &amp;#039;[[s:The Doctrine and Covenants/Section 128#19|Doctrine + Covenants 128:19–22, 24]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- BoM intro&lt;br /&gt;
function p:test_39_bom_title_page()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Title Page to the Book of Mormon|ttlpg}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Title Page|Title Page to the Book of Mormon]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- BoM 3 witnesses&lt;br /&gt;
function p:test_40_bom_3_witnesses()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|3 Witnesses|three}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Testimony of Three Witnesses|3 Witnesses]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- BoM 8 witnesses&lt;br /&gt;
function p:test_41_bom_8_witnesses()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|8 Witnesses|eight}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Testimony of Eight Witnesses|8 Witnesses]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Lectures on Faith&lt;br /&gt;
function p:test_42_Lectures()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Lectures re Faith|lof}}&amp;#039;, &amp;#039;[[s:Lectures on Faith|Lectures re Faith]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Lectures on Faith&lt;br /&gt;
function p:test_43_Lecture_Seventh()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Lectures about Faith|lof|7}}&amp;#039;, &amp;#039;[[s:Lectures on Faith/Lecture Seventh|Lectures about Faith 7]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Forgotten second parameter&lt;br /&gt;
--		It&amp;#039;s easy to forget to &amp;quot;repeat&amp;quot; the second parameter for the book name, especially if you use&lt;br /&gt;
--		the full book name as the display text, so these next tests check for a fix for that&lt;br /&gt;
function p:test_44_forgotten_2nd_param_1()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Alma|7}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Alma#chapter_7|Alma 7]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Forgotten second parameter&lt;br /&gt;
function p:test_45_forgotten_2nd_param_2()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Alma|7|11}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Alma#7:11|Alma 7:11]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Forgotten second parameter&lt;br /&gt;
function p:test_46_forgotten_2nd_param_3()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Alma|7|11|–13, 23–24|||x}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/Alma#7:11|Alma 7:11–13, 23–24]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Forgotten second parameter and abbreviation in displayText&lt;br /&gt;
function p:test_47_forgotten_2nd_param_4()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|2 Ne.|4|28|30}}&amp;#039;, &amp;#039;[[s:Book of Mormon (1981)/2 Nephi#4:28|2 Ne. 4:28–30]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Graceful error handling for bad LoF numbers&lt;br /&gt;
function p:test_48_bad_lof_param()&lt;br /&gt;
	self:preprocess_equals(&amp;#039;{{LDS|Lectures about Faith|lof|8}}&amp;#039;, &amp;#039;[[s:Lectures on Faith|Lectures about Faith 8 (invalid)]]&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;Biggins</name></author>
	</entry>
</feed>