Difference between revisions of "Module:Citation/CS1/testcases4"

From blackwiki
Jump to navigation Jump to search
blackwiki>Trappist the monk
blackwiki>Trappist the monk
Line 105: Line 105:
 
{'arxiv=1501.4444v'}, -- missing version number (fail)
 
{'arxiv=1501.4444v'}, -- missing version number (fail)
 
{'arxiv=1501.4444v1'}, -- with version number (pass)
 
{'arxiv=1501.4444v1'}, -- with version number (pass)
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< A S I N >----------------------------------------------------------------------
 +
]]
 +
 +
function p:test_asin()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'asin=4-12346789X'}, -- invalid char: hyphen (fail)
 +
{'asin=412346789'}, -- length (9) (fail)
 +
{'asin=ABCDEFGHIJK'}, -- length (11) (fail)
 +
{'asin=ABCDEFGHIJ'}, -- valid (pass)
 +
{'asin=412346789X'}, -- valid (isbn) (pass)
 +
 +
{'asin=ABCDEFGHIJ|asin-tld=com'}, -- invalid tld (fail)
 +
{'asin=ABCDEFGHIJ|asin-tld=jp'}, -- valid tld (pass)
 +
{'asin=ABCDEFGHIJ|asin-tld=uk'}, -- valid tld (pass)
 +
{'asin=ABCDEFGHIJ|asin-tld=au'}, -- valid tld (pass)
 +
{'asin=ABCDEFGHIJ|asin-tld=br'}, -- valid tld (pass)
 +
{'asin=ABCDEFGHIJ|asin-tld=mx'}, -- valid tld (pass)
 +
 
},
 
},
 
{nowiki=false, templatestyles=true}
 
{nowiki=false, templatestyles=true}
Line 261: Line 287:
 
-- doi-broken date
 
-- doi-broken date
 
{'doi=10.1000/something |doi-broken-date=2020'}, -- valid doi-broken date (pass)
 
{'doi=10.1000/something |doi-broken-date=2020'}, -- valid doi-broken date (pass)
{'doi=10.1000/something |doi-broken-date=January 1900'}, -- valid doi-broken date (pass)
+
{'doi=10.1000/something |doi-broken-date=January 1900'}, -- valid doi-broken date (pass) TODO: valid but not valid
 
{'doi=10.1000/something |doi-broken-date=XXXX'}, -- invalid doi-broken date (fail)
 
{'doi=10.1000/something |doi-broken-date=XXXX'}, -- invalid doi-broken date (fail)
 
{'doi=10.1000/something |doi-broken-date=January 3500'}, -- invalid doi-broken date (fail)
 
{'doi=10.1000/something |doi-broken-date=January 3500'}, -- invalid doi-broken date (fail)
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< H D L >------------------------------------------------------------------------
 +
]]
 +
 +
function p:test_hdl()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'hdl=abc 123/abc123'}, -- invalid prefix (fail)
 +
{'hdl=abc–123/abc123'}, -- invalid prefix (fail)
 +
{'hdl=abc123/abc 123'}, -- invalid suffix (fail)
 +
{'hdl=abc123/abc–123'}, -- invalid suffix (fail)
 +
{'hdl=abc123/abc123.'}, -- trailing dot (fail)
 +
{'hdl=abc123/abc123,'}, -- trailing comma (fail)
 +
{'hdl=abc123/abc123'}, -- valid (pass)
 +
 +
-- query strings
 +
{'hdl=abc123/abc123?not_a_query=string'}, -- valid (pass)
 +
{'hdl=abc123/abc123?noredirect=string'}, -- valid (pass) TODO: does this take a value?
 +
{'hdl=abc123/abc123?ignore_aliases=string'}, -- valid (pass) TODO: does this take a value? TODO: fix underscore
 +
{'hdl=abc123/abc123?auth=string'}, -- valid (pass) TODO: does this take a value?
 +
{'hdl=abc123/abc123?cert=string'}, -- valid (pass) TODO: does this take a value?
 +
{'hdl=abc123/abc123?index=string'}, -- valid (pass)
 +
{'hdl=abc123/abc123?type=string'}, -- valid (pass)
 +
{'hdl=abc123/abc123?urlappend=string'}, -- valid (pass)
 +
{'hdl=abc123/abc123?locatt=string'}, -- valid (pass)
 +
{'hdl=abc123/abc123?action=string'}, -- valid (pass)
 +
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< T E S T _ I S B N >------------------------------------------------------------
 +
]]
 +
 +
function p:test_isbn()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'isbn=3–123467899'}, -- invalid character (ndash) (fail)
 +
{'isbn=312346789'}, -- length (9) (fail)
 +
{'isbn=31234678999'}, -- length (11) (fail)
 +
{'isbn=41234678X9'}, -- X in the wrong spot (fail)
 +
{'isbn=3123467896'}, -- checkdigit (fail)
 +
{'isbn=3123467899'}, -- valid (pass)
 +
{'isbn=412346789X'}, -- valid (pass)
 +
{'isbn=3-123467899'}, -- valid (pass)
 +
{'isbn=4-12346789X'}, -- valid (pass)
 +
{'isbn=3 123467899'}, -- valid (pass)
 +
{'isbn=4 12346789X'}, -- valid (pass)
 +
 +
{'isbn=978-01234567866'}, -- length (14) (fail)
 +
{'isbn=978-012345678'}, -- length (12) (fail)
 +
 +
{'isbn=978-012345678X'}, -- isbn13 is digits only (fail)
 +
{'isbn=977-0123456786'}, -- 978 or 979 prefix only (fail)
 +
{'isbn=979-0123456785'}, -- 9790 is ismn (fail)
 +
{'isbn=978-0123456788'}, -- check digit (fail)
 +
 +
{'isbn=9780123456786'}, -- valid 978 (pass)
 +
{'isbn=9791123456782'}, -- valid 979 (pass)
 +
{'isbn=978-0123456786'}, -- valid 978 (pass)
 +
{'isbn=979-1123456782'}, -- valid 979 (pass)
 +
{'isbn=978 0123456786'}, -- valid 978 (pass)
 +
{'isbn=979 1123456782'}, -- valid 979 (pass)
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< T E S T _ I S M N >------------------------------------------------------------
 +
]]
 +
 +
function p:test_ismn()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'ismn=979-01234567856'}, -- length (14) (fail)
 +
{'ismn=979-012345678'}, -- length (12) (fail)
 +
{'ismn=979-012345678X'}, -- digits only (fail)
 +
{'ismn=979-1123456782'}, -- group designator must be 0 (fail)
 +
{'ismn=979-0123456788'}, -- check digit (fail)
 +
 +
{'ismn=979–0123456785'}, -- valid (pass) TODO: make this same as isbn; support ndash in both or in neither
 +
{'ismn=9790123456785'}, -- valid (pass)
 +
{'ismn=979-0123456785'}, -- valid (pass)
 +
{'ismn=979 0123456785'}, -- valid (pass)
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< T E S T _ I S S N >------------------------------------------------------------
 +
]]
 +
 +
function p:test_issn()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'issn=0123-45601'}, -- length (9) (fail)
 +
{'issn=0123-456'}, -- length (7) (fail)
 +
{'issn=7123-45X6'}, -- X mispositioned (fail)
 +
{'issn=0123-4566'}, -- check digit (fail)
 +
 +
{'issn=0123–4560'}, -- valid (pass) TODO: make this same as isbn; support ndash in both or in neither
 +
{'issn=01234560'}, -- valid (pass)
 +
{'issn=7123-456X'}, -- valid (pass)
 +
{'issn=7123 456X'}, -- valid (pass)
 +
},
 +
{nowiki=false, templatestyles=true}
 +
)
 +
end
 +
 +
 +
--[[--------------------------< T E S T _ J F M >--------------------------------------------------------------
 +
]]
 +
 +
function p:test_jfm()
 +
    self:preprocess_equals_preprocess_many(
 +
    '{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
 +
{
 +
{'jfm=1.4444.22'}, -- missing digit (fail)
 +
{'jfm=22.333.22'}, -- missing digit (fail)
 +
{'jfm=22.4444.1'}, -- missing digit (fail)
 +
 +
{'jfm=333.4444.22'}, -- to many digit (fail)
 +
{'jfm=22.55555.22'}, -- to many digit (fail)
 +
{'jfm=22.4444.333'}, -- to many digit (fail)
 +
 +
{'jfm=224444.22'}, -- missing separator (fail)
 +
{'jfm=22.444422'}, -- missing separator (fail)
 +
 +
{'jfm=jfm22.4444.22'}, -- jfm prefix (pass)
 +
{'jfm=22.4444.22'}, -- valid (pass)
 
},
 
},
 
{nowiki=false, templatestyles=true}
 
{nowiki=false, templatestyles=true}

Revision as of 19:56, 7 September 2020

Documentation for this module may be created at Module:Citation/CS1/testcases4/doc

--[=[

Unit tests for [[Module:Citation/CS1/Identifiers]].

Click talk page to run tests.

]=]

local p = require('Module:UnitTests')


--[[--------------------------< T O D A Y _ P L U S _ O F F S E T _ G E T >------------------------------------

returns date offset from today by <offset> in <format> (#time parser function formatting)
	Y - four digit year
	m - two digit month
	d - two digit day

<offset> must include units: days, months, years

]]

local function today_plus_offset_get (format, offset)
	return mw.getContentLanguage():formatDate(format, 'today ' .. offset and ('+ ' .. offset) or '');
end


--[[--------------------------< A R X I V _ 9 1 0 7 _ 0 7 0 3 >------------------------------------------------
]]

function p:test_arxiv_9107_0703()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
																				-- legitimate date range
			{'arxiv=a.a/9007333'},												-- invalid yymm (fail)
			{'arxiv=a.a/9106333'},												-- invalid yymm (fail)
			{'arxiv=a.a/9107333'},												-- valid yymm (pass)
			{'arxiv=a.a/0703333'},												-- valid yymm (pass)
			{'arxiv=a.a/0704333'},												-- invalid yymm (fail)
			{'arxiv=a.a/0803333'},												-- valid yymm (pass)
																				-- archive & class
			{'arxiv=.a/9107333'},												-- without archive (fail)
			{'arxiv=aa/9107333'},												-- without class (pass)
			
																				-- number
			{'arxiv=aa/910722'},												-- not enough digits (fail)
			{'arxiv=aa/91074444'},												-- too many digits (fail)

																				-- version
			{'arxiv=a.a/9107333v'},												-- missing version number (fail)
			{'arxiv=a.a/9107333v1'},											-- with version number (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< A R X I V _ 0 7 0 4 _ 1 4 1 2 >------------------------------------------------
]]

function p:test_arxiv_0704_1412()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
																				-- date range
			{'arxiv=0612.4444'},												-- invalid yymm (fail)
			{'arxiv=0703.4444'},												-- invalid yymm (fail)
			{'arxiv=0704.4444'},												-- valid yymm (pass)
			{'arxiv=1412.4444'},												-- valid yymm (pass)
			{'arxiv=1413.4444'},												-- invalid yymm (fail)
			{'arxiv=1501.4444'},												-- invalid yymm (fail)

																				-- number
			{'arxiv=0704.333'},													-- not enough digits (fail)
			{'arxiv=0704.55555'},												-- too many digits (fail)

																				-- version
			{'arxiv=0704.4444v'},												-- missing version number (fail)
			{'arxiv=0704.4444v1'},												-- with version number (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< A R X I V _ 1 5 0 1 >----------------------------------------------------------
]]

function p:test_arxiv_1501()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
																				-- date range
			{'arxiv=1412.55555'},												-- invalid yymm (fail)
			{'arxiv=1500.55555'},												-- invalid yymm (fail)
			{'arxiv=1501.55555'},												-- valid yymm (pass)
			{'arxiv=1513.55555'},												-- invalid yymm (fail)

																				-- number
			{'arxiv=1501.4444'},												-- not enough digits (fail)
			{'arxiv=1501.666666'},												-- too many digits (fail)

																				-- version
			{'arxiv=1501.4444v'},												-- missing version number (fail)
			{'arxiv=1501.4444v1'},												-- with version number (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< A S I N >----------------------------------------------------------------------
]]

function p:test_asin()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'asin=4-12346789X'},												-- invalid char: hyphen (fail)
			{'asin=412346789'},													-- length (9) (fail)
			{'asin=ABCDEFGHIJK'},												-- length (11) (fail)
			{'asin=ABCDEFGHIJ'},												-- valid (pass)
			{'asin=412346789X'},												-- valid (isbn) (pass)

			{'asin=ABCDEFGHIJ|asin-tld=com'},									-- invalid tld (fail)
			{'asin=ABCDEFGHIJ|asin-tld=jp'},									-- valid tld (pass)
			{'asin=ABCDEFGHIJ|asin-tld=uk'},									-- valid tld (pass)
			{'asin=ABCDEFGHIJ|asin-tld=au'},									-- valid tld (pass)
			{'asin=ABCDEFGHIJ|asin-tld=br'},									-- valid tld (pass)
			{'asin=ABCDEFGHIJ|asin-tld=mx'},									-- valid tld (pass)
			
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< B I B C O D E >----------------------------------------------------------------
]]

function p:test_bibcode()
	local this_year = today_plus_offset_get ('Y', '0 year');					-- get this year
	
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
																				-- years
			{'bibcode=0999a&1.b2.c3.d4..e'},									-- invalid yyyy (fail)
			{'bibcode=1000a&1.b2.c3.d4..e'},									-- valid yyyy (pass)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.d4..e'},						-- valid yyyy (pass)
			{'bibcode=' .. today_plus_offset_get ('Y', '1 year') .. 'a&1.b2.c3.d4..e'},	-- valid yyyy (pass)
			{'bibcode=' .. today_plus_offset_get ('Y', '2 year') .. 'a&1.b2.c3.d4..e'},	-- invalid yyyy (fail)

			{'bibcode=' .. this_year .. '#&1.b2.c3.d4..e'},						-- invalid [5] (fail)
			{'bibcode=' .. this_year .. 'a#1.b2.c3.d4..e'},						-- invalid [6] (fail)
			{'bibcode=' .. this_year .. 'a&#.b2.c3.d4..e'},						-- invalid [7] (fail)
			{'bibcode=' .. this_year .. 'a&1#b2.c3.d4..e'},						-- invalid [8] (fail)
			
			{'bibcode=' .. this_year .. 'a&..b2.c3.d4..e'},						-- ampersand preceeds dot (fail)

			{'bibcode=' .. this_year .. 'a&1.#2.c3.d4..e'},						-- invalid [9] (fail)
			{'bibcode=' .. this_year .. 'a&1.b#.c3.d4..e'},						-- invalid [10] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2#c3.d4..e'},						-- invalid [11] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.#3.d4..e'},						-- invalid [12] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c#.d4..e'},						-- invalid [13] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3#d4..e'},						-- invalid [14] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.#4..e'},						-- invalid [15] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.d#..e'},						-- invalid [16] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.d4#.e'},						-- invalid [17] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.d4.#e'},						-- invalid [18] (fail)
			{'bibcode=' .. this_year .. 'a&1.b2.c3.d4..#'},						-- invalid [19] (fail)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< B I O R X I V >----------------------------------------------------------------
]]

function p:test_biorxiv()
	local today = today_plus_offset_get ('Y.m.d', '0 year');					
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
																				-- years
			{'biorxiv=10.1100/666666'},											-- invalid prefix (fail)
			{'biorxiv=10.1101/666666'},											-- valid prefix (pass)
			{'biorxiv=11.1101/666666'},											-- invalid prefix (fail)

			{'biorxiv=10.1101/55555'},											-- invalid identifier (fail)
			{'biorxiv=10.1101/7777777'},										-- invalid identifier (fail)
----			
			{'biorxiv=10.1100/2019.12.10.666666'},								-- invalid date (fail)
			{'biorxiv=10.1101/2019.12.11.666666'},								-- valid date (pass)
			{'biorxiv=10.1101/2019.00.11.666666'},								-- invalid date (fail)
			{'biorxiv=10.1101/2019.13.11.666666'},								-- invalid date (fail)
			{'biorxiv=10.1101/2019.12.00.666666'},								-- invalid date (fail)
			{'biorxiv=10.1101/2019.12.32.666666'},								-- invalid date (fail)
			
			{'biorxiv=10.1101/' .. today .. '.666666'},							-- valid date (pass)
			{'biorxiv=10.1101/' .. today_plus_offset_get ('Y.m.d', '1 year') .. '.666666'},	-- valid date (pass)

			{'biorxiv=10.1101/' .. today .. '55555'},							-- invalid identifier (fail)
			{'biorxiv=10.1101/' .. today .. '7777777'},							-- invalid identifier (fail)

			{'biorxiv=10.1101/' .. today .. '.666666v'},							-- valid date (pass)
			{'biorxiv=10.1101/' .. today .. '.666666v1'},							-- valid date (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< C I T E S E E R X >------------------------------------------------------------
]]

function p:test_citeseerx()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'citeseerx=11.1.1.1234.1234'},										-- invalid site id (fail)
			{'citeseerx=10.0.1.1234.1234'},										-- invalid deployment id (fail)
			{'citeseerx=10.1.0.1234.1234'},										-- invalid type (fail)
			{'citeseerx=10.1.1.0234.1234'},										-- invalid bin (fail)
			{'citeseerx=10.1.1.1234.0234'},										-- invalid record (fail)
			{'citeseerx=10.1.1.1234.1234'},										-- invalid record (fail)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< D O I >------------------------------------------------------------------------
]]

function p:test_doi()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'doi=10.1000/something'},											-- valid directory indicator (pass)
			{'doi=11.1000/something'},											-- invalid directory indicator (fail)
			{'doi=10.10 00/something'},											-- invalid registrant (fail)
			{'doi=10.5555/something'},											-- invalid registrant (fail)
			{'doi=10.666666/something'},										-- invalid registrant (fail)


	-- < four digit registrant w/o subcode
			{'doi=10.1/something'},												-- invalid registrant (fail)
			{'doi=10.22/something'},											-- invalid registrant (fail)
			{'doi=10.333/something'},											-- invalid registrant (fail)

	-- < four digit registrant w/ subcode
			{'doi=10.1.1/something'},											-- valid registrant (pass)
			{'doi=10.22.1/something'},											-- valid registrant (pass)
			{'doi=10.333.1/something'},											-- valid registrant (pass)

	-- four digit registrant w/o subcode
			{'doi=10.0999/something'},											-- invalid registrant (fail)
			{'doi=10.1000/something'},											-- valid registrant (pass)
			{'doi=10.9999/something'},											-- valid registrant (pass)

	-- four digit registrant w/ subcode
			{'doi=10.0999.1/something'},										-- invalid registrant (fail)
			{'doi=10.1000.1/something'},										-- valid registrant (pass)
			{'doi=10.9999.1/something'},										-- valid registrant (pass)

	-- five digit registrant w/o subcode
			{'doi=10.09999/something'},											-- invalid registrant (fail)
			{'doi=10.10000/something'},											-- valid registrant (pass)
			{'doi=10.49999/something'},											-- valid registrant (pass)
			{'doi=10.50000/something'},											-- invalid registrant (fail)

	-- five digit registrant w/ subcode
			{'doi=10.09999.1/something'},										-- invalid registrant (fail)
			{'doi=10.10000.1/something'},										-- valid registrant (pass)
			{'doi=10.39999.1/something'},										-- valid registrant (pass)
			{'doi=10.40000.1/something'},										-- invalid registrant (fail)

	--terminal punctuation
			{'doi=10.1000/something.'},											-- trailing dot (fail)
			{'doi=10.1000/something,'},											-- trailing comma (fail)

			{'doi=10.1000/some thing'},											-- space character in identifier (fail)

	-- doi-broken date
			{'doi=10.1000/something |doi-broken-date=2020'},					-- valid doi-broken date (pass)
			{'doi=10.1000/something |doi-broken-date=January 1900'},			-- valid doi-broken date (pass) TODO: valid but not valid
			{'doi=10.1000/something |doi-broken-date=XXXX'},					-- invalid doi-broken date (fail)
			{'doi=10.1000/something |doi-broken-date=January 3500'},			-- invalid doi-broken date (fail)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< H D L >------------------------------------------------------------------------
]]

function p:test_hdl()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'hdl=abc 123/abc123'},												-- invalid prefix (fail)
			{'hdl=abc–123/abc123'},												-- invalid prefix (fail)
			{'hdl=abc123/abc 123'},												-- invalid suffix (fail)
			{'hdl=abc123/abc–123'},												-- invalid suffix (fail)
			{'hdl=abc123/abc123.'},												-- trailing dot (fail)
			{'hdl=abc123/abc123,'},												-- trailing comma (fail)
			{'hdl=abc123/abc123'},												-- valid (pass)

		-- query strings
			{'hdl=abc123/abc123?not_a_query=string'},							-- valid (pass)
			{'hdl=abc123/abc123?noredirect=string'},							-- valid (pass) TODO: does this take a value?
			{'hdl=abc123/abc123?ignore_aliases=string'},						-- valid (pass) TODO: does this take a value? TODO: fix underscore
			{'hdl=abc123/abc123?auth=string'},									-- valid (pass) TODO: does this take a value?
			{'hdl=abc123/abc123?cert=string'},									-- valid (pass) TODO: does this take a value?
			{'hdl=abc123/abc123?index=string'},									-- valid (pass)
			{'hdl=abc123/abc123?type=string'},									-- valid (pass)
			{'hdl=abc123/abc123?urlappend=string'},								-- valid (pass)
			{'hdl=abc123/abc123?locatt=string'},								-- valid (pass)
			{'hdl=abc123/abc123?action=string'},								-- valid (pass)

		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< T E S T _ I S B N >------------------------------------------------------------
]]

function p:test_isbn()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'isbn=3–123467899'},												-- invalid character (ndash) (fail)
			{'isbn=312346789'},													-- length (9) (fail)
			{'isbn=31234678999'},												-- length (11) (fail)
			{'isbn=41234678X9'},												-- X in the wrong spot (fail)
			{'isbn=3123467896'},												-- checkdigit (fail)
			{'isbn=3123467899'},												-- valid (pass)
			{'isbn=412346789X'},												-- valid (pass)
			{'isbn=3-123467899'},												-- valid (pass)
			{'isbn=4-12346789X'},												-- valid (pass)
			{'isbn=3 123467899'},												-- valid (pass)
			{'isbn=4 12346789X'},												-- valid (pass)

			{'isbn=978-01234567866'},											-- length (14) (fail)
			{'isbn=978-012345678'},												-- length (12) (fail)

			{'isbn=978-012345678X'},											-- isbn13 is digits only (fail)
			{'isbn=977-0123456786'},											-- 978 or 979 prefix only (fail)
			{'isbn=979-0123456785'},											-- 9790 is ismn (fail)
			{'isbn=978-0123456788'},											-- check digit (fail)
			
			{'isbn=9780123456786'},												-- valid 978 (pass)
			{'isbn=9791123456782'},												-- valid 979 (pass)
			{'isbn=978-0123456786'},											-- valid 978 (pass)
			{'isbn=979-1123456782'},											-- valid 979 (pass)
			{'isbn=978 0123456786'},											-- valid 978 (pass)
			{'isbn=979 1123456782'},											-- valid 979 (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< T E S T _ I S M N >------------------------------------------------------------
]]

function p:test_ismn()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'ismn=979-01234567856'},											-- length (14) (fail)
			{'ismn=979-012345678'},												-- length (12) (fail)
			{'ismn=979-012345678X'},											-- digits only (fail)
			{'ismn=979-1123456782'},											-- group designator must be 0 (fail)
			{'ismn=979-0123456788'},											-- check digit (fail)

			{'ismn=979–0123456785'},											-- valid (pass) TODO: make this same as isbn; support ndash in both or in neither
			{'ismn=9790123456785'},												-- valid (pass)
			{'ismn=979-0123456785'},											-- valid (pass)
			{'ismn=979 0123456785'},											-- valid (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< T E S T _ I S S N >------------------------------------------------------------
]]

function p:test_issn()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'issn=0123-45601'},												-- length (9) (fail)
			{'issn=0123-456'},													-- length (7) (fail)
			{'issn=7123-45X6'},													-- X mispositioned (fail)
			{'issn=0123-4566'},													-- check digit (fail)

			{'issn=0123–4560'},													-- valid (pass) TODO: make this same as isbn; support ndash in both or in neither
			{'issn=01234560'},													-- valid (pass)
			{'issn=7123-456X'},													-- valid (pass)
			{'issn=7123 456X'},													-- valid (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


--[[--------------------------< T E S T _ J F M >--------------------------------------------------------------
]]

function p:test_jfm()
    self:preprocess_equals_preprocess_many(
    	'{{cite book/new |title=Title |', '}}', '{{cite book |title=Title |', '}}',
		{
			{'jfm=1.4444.22'},													-- missing digit (fail)
			{'jfm=22.333.22'},													-- missing digit (fail)
			{'jfm=22.4444.1'},													-- missing digit (fail)

			{'jfm=333.4444.22'},												-- to many digit (fail)
			{'jfm=22.55555.22'},												-- to many digit (fail)
			{'jfm=22.4444.333'},												-- to many digit (fail)

			{'jfm=224444.22'},													-- missing separator (fail)
			{'jfm=22.444422'},													-- missing separator (fail)

			{'jfm=jfm22.4444.22'},												-- jfm prefix (pass)
			{'jfm=22.4444.22'},													-- valid (pass)
		},
		{nowiki=false, templatestyles=true}
	)
end


return p