--[=[ Unit tests for [[Module:Citation/CS1]] error messages. This is not intended totest every possible thing that can make an error message; rather, it is to testthe creation and rendering of the messages themselves.
Tests are displayed on the talk page alphabetically by test name. By convention,tests for errors are all lowercase, especially after "test_" e.g. test_disp_name,which differentiates them from maintenance messages, which have an uppercaseimmediately after the "_" e.g. test_Ref_maint.
Click talk page to run tests.
]=]
local p = require('Module:UnitTests')--
function p:test_wikilink_in_url self:preprocess_equals_preprocess_many('Journal . ', 'Journal . ', , )end
----------------------------< T E S T _ V A U T H O R S >----------------------------------------------------
function p:test_vauthors self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ V A N C O U V E R >--------------------------------------------------
function p:test_vancouver self:preprocess_equals_preprocess_many('Title . vanc . ', 'Book: Title . vanc . ', , )end
----------------------------< T E S T _ T R A N S _ M I S S I N G _ T I T L E >------------------------------
function p:test_trans_missing_title self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ T E X T _ I G N O R E D >--------------------------------------------
function p:test_text_ignored self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ S S R N _ M I S S I N G >--------------------------------------------
function p:test_ssrn_missing self:preprocess_equals_preprocess_many('Title', '. ', 'Title', '. ', , )end
----------------------------< T E S T _ S C R I P T _ P A R A M E T E R >------------------------------------
function p:test_script_parameter self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S >----------------------------
function p:test_redundant_parameters self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 2 >------------------------
function p:test_redundant_parameters_2 self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 3 >------------------------
function p:test_redundant_parameters_3 self:preprocess_equals_preprocess_many('Title . ', 'Encyclopedia: Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 4 >------------------------
function p:test_redundant_parameters_4 self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 5 >------------------------
function p:test_redundant_parameters_5 self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 6 >------------------------
function p:test_redundant_parameters_6 self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ R E D U N D A N T _ P A R A M E T E R S _ 7 >------------------------
function p:test_redundant_parameters_7 self:preprocess_equals_preprocess_many('Title . Series . ', 'Title . Series . ', , )end
----------------------------< T E S T _ P A R A M E T E R _ I G N O R E D _ S U G G E S T >------------------
function p:test_parameter_ignored_suggest self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ P A R A M E T E R _ I G N O R E D >----------------------------------
function p:test_parameter_ignored self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ P A R A M E T E R _ I G N O R E D _ 2 >------------------------------
function p:test_parameter_ignored_2 self:preprocess_equals_preprocess_many('Title . 123456 . ', 'Title . 123456 . ', , )end
----------------------------< T E S T _ P A R A M E T E R _ I G N O R E D _ 3 >------------------------------
function p:test_parameter_ignored_3 self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ P A R A M _ H A S _ E X T _ L I N K >--------------------------------
function p:test_param_has_ext_link self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ P A R A M _ A C C E S S _ R E Q U I R E S _ P A R A M >--------------
function p:test_param_access_requires_param self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ P A R A M _ A C C E S S _ R E Q U I R E S _ P A R A M _ 2 >----------
function p:test_param_access_requires_param_2 self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ M I S S I N G _ P I P E >--------------------------------------------
function p:test_missing_pipe self:preprocess_equals_preprocess_many(' Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ M I S S I N G _ P E R I O D I C A L >--------------------------------
function p:test_missing_periodical self:preprocess_equals_preprocess_many('Title', '. ', 'Title', '. ', , )end
----------------------------< T E S T _ M I S S I N G _ P E R I O D I C A L _ 2 >----------------------------
function p:test_missing_periodical_2 self:preprocess_equals_preprocess_many('Title', '. ', 'Title', '. ', , )end
----------------------------< T E S T _ M I S S I N G _ N A M E >--------------------------------------------
function p:test_missing_name self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ I N V I S I B L E _ C H A R >----------------------------------------
function p:test_invisible_char self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ I N V A L I D _ P A R A M _ V A L >----------------------------------
function p:test_invalid_param_val self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ F O R M A T _ M I S S I N G _ U R L >--------------------------------
function p:test_format_missing_url self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ F I R S T _ M I S S I N G _ L A S T >--------------------------------
function p:test_first_missing_last self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ E T A L >------------------------------------------------------------
function p:test_etal self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ E M P T Y _ C I T A T I O N >----------------------------------------
function p:test_empty_citation self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ D O I B R O K E N _ M I S S I N G _ D O I >--------------------------
function p:test_doibroken_missing_doi self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ D E P R E C A T E D _ P A R A M S >----------------------------------
this here for completeness; can't test deprecated param error messaging without actual deprecated parameters; atthis writing, 2020-06-10 there are no deprecated parameters
function p:test_deprecated_params self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ C O N T R I B U T O R _ M I S S I N G _ R E Q U I R E D _ P A R A M >
function p:test_contributor_missing_required_param self:preprocess_equals_preprocess_many('Title . Contributor . ', 'Book: Title . Contributor . ', , )end
----------------------------< T E S T _ C O N T R I B U T O R _ I G N O R E D >------------------------------
function p:test_contributor_ignored self:preprocess_equals_preprocess_many('Title . Contributor . Journal', '. ', 'Title . Contributor . Journal', '. ', , )end
----------------------------< T E S T _ C L A S S _ I G N O R E D >------------------------------------------
function p:test_class_ignored self:preprocess_equals_preprocess_many('Title . Author . ', 'Title . Author . ', , )end
----------------------------< T E S T _ C I T E S E E R X _ M I S S I N G >----------------------------------
function p:test_citeseerx_missing self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ C I T E _ W E B _ U R L >--------------------------------------------
function p:test_cite_web_url self:preprocess_equals_preprocess_many('', 'Web site: ', , )end
----------------------------< T E S T _ C I T E _ W E B _ U R L _ 2 >----------------------------------------
function p:test_cite_web_url_2 self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ C I T A T I O N _ M I S S I N G _ T I T L E >------------------------
function p:test_citation_missing_title self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ C I T A T I O N _ M I S S I N G _ T I T L E _ 2 >--------------------
function p:test_citation_missing_title_2 self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ C H A P T E R _ I G N O R E D >--------------------------------------
function p:test_chapter_ignored self:preprocess_equals_preprocess_many('Title . ', 'News: Title . ', , )end
----------------------------< T E S T _ B I O R X I V _ M I S S I N G >--------------------------------------
function p:test_biorxiv_missing self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ B A R E _ U R L _ M I S S I N G _ T I T L E >------------------------
function p:test_bare_url_missing_title self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ B A R E _ U R L _ M I S S I N G _ T I T L E _ 2 >--------------------
function p:test_bare_url_missing_title_2 self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ B A D _ Z B L >------------------------------------------------------
function p:test_bad_zbl self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ U S E N E T _ I D >------------------------------------------
function p:test_bad_usenet_id self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ B A D _ U R L >------------------------------------------------------
function p:test_bad_url self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ S S R N >----------------------------------------------------
function p:test_bad_ssrn self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ S B N >------------------------------------------------------
function p:test_bad_sbn self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ S 2 C I D >--------------------------------------------------
function p:test_bad_s2cid self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ O C L C >----------------------------------------------------
function p:test_bad_oclc self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ P M I D >----------------------------------------------------
function p:test_bad_pmid self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ P M C >------------------------------------------------------
function p:test_bad_pmc self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ P A R A M _ L I N K >----------------------------------------
function p:test_bad_paramlink self:preprocess_equals_preprocess_many('', 'Book: ', , )end
----------------------------< T E S T _ B A D _ O L >--------------------------------------------------------
function p:test_bad_ol self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ M R >--------------------------------------------------------
function p:test_bad_mr self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ L C C N >----------------------------------------------------
function p:test_bad_lccn self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ J F M >------------------------------------------------------
function p:test_bad_jfm self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ I S S N >----------------------------------------------------
function p:test_bad_issn self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ I S M N >----------------------------------------------------
function p:test_bad_ismn self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ I S B N >----------------------------------------------------
function p:test_bad_isbn self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ H D L >------------------------------------------------------
function p:test_bad_hdl self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ D O I >------------------------------------------------------
function p:test_bad_doi self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ D A T E >----------------------------------------------------
function p:test_bad_date self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ C I T E S E E R X >------------------------------------------
function p:test_bad_citeseerx self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ B I O R X I V >----------------------------------------------
function p:test_bad_biorxiv self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ B I B C O D E >----------------------------------------------
function p:test_bad_bibcode self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ B A D _ A S I N >----------------------------------------------------
function p:test_bad_asin self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ B A D _ A R X I V >--------------------------------------------------
function p:test_bad_arxiv self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ A R X I V _ M I S S I N G >------------------------------------------
function p:test_arxiv_missing self:preprocess_equals_preprocess_many('', '', , )end
----------------------------< T E S T _ A R C H I V E _ U R L >----------------------------------------------
function p:test_archive_url self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ A R C H I V E _ M I S S I N G _ U R L >------------------------------
function p:test_archive_missing_url self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ A P O S T R O P H E _ M A R K U P >----------------------------------
function p:test_apostrophe_markup self:preprocess_equals_preprocess_many('Title . ', 'News: Title . ', , )end
----------------------------< T E S T _ A C C E S S D A T E _ M I S S I N G _ U R L >------------------------
function p:test_accessdate_missing_url self:preprocess_equals_preprocess_many('Title . Journal . ', 'Title . Journal . ', , )end
----------------------------< T E S T _ E X T R A _ T E X T >------------------------------------------------
function p:test_extra_text self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ D I S P _ N A M E >--------------------------------------------------
function p:test_disp_name self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
--
function p:test_ASIN_uses_ISBN self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ A R C H I V E D _ C O P Y >------------------------------------------
function p:test_Archived_copy self:preprocess_equals_preprocess_many('https://example.com . https://archive.org . 2020-07-29 . ', 'Book: https://example.com . https://archive.org . 2020-07-29 . ', , )end
----------------------------< T E S T _ A U T H O R S >------------------------------------------------------
function p:test_Authors self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
--
function p:test_Bot_unknown self:preprocess_equals_preprocess_many(' Title . https://archive.org . 2020-07-29 . ', 'Book: Title . https://archive.org . 2020-07-29 . ', , )end
----------------------------< T E S T _ D A T E _ F O R M A T >----------------------------------------------
function p:test_Date_format self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ D A T E _ Y E A R >--------------------------------------------------
function p:test_Date_year self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ D I S C O U R A G E D _ P A R A M >----------------------------------
function p:test_Discourage_param self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , ) self:preprocess_equals_preprocess_many('Series . ', 'Series . ', , )end
----------------------------< T E S T _ E M B A R G O >------------------------------------------------------
function p:test_Pmc_embargo_date self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ E X T R A _ P U N C T >----------------------------------------------
function p:test_Extra_punct self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ E X T R A _ T E X T _ N A M E S >------------------------------------
function p:test_Extra_text_names self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ I G N O R E _ I S B N _ E R R >--------------------------------------
function p:test_Ignore_isbn_err self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ L O C A T I O N >----------------------------------------------------
function p:test_Location self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ M U L T _ N A M E S >------------------------------------------------
function p:test_Mult_names self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ N U M E R I C _ N A M E S >------------------------------------------
function p:test_Numeric_names self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ O T H E R S >--------------------------------------------------------
function p:test_Others self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )endfunction p:test_Others_avmn self:preprocess_equals_preprocess_many('Title . ', 'Title . ', , )end
----------------------------< T E S T _ P M C _ F O R M A T >------------------------------------------------
function p:test_Pmc_format self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ R E F _ H A R V >----------------------------------------------------
function p:test_Ref_maint self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ U N F I T >----------------------------------------------------------
function p:test_Unfit self:preprocess_equals_preprocess_many(' Title . https://archive.org . 2020-07-29 . ', 'Book: Title . https://archive.org . 2020-07-29 . ', , )end
----------------------------< T E S T _ U N K N O W N _ L A N G >--------------------------------------------
function p:test_Unknown_lang self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
----------------------------< T E S T _ U N T I T L E D >----------------------------------------------------
function p:test_Untitled self:preprocess_equals_preprocess_many('Journal . ', 'Journal . ', , )end
----------------------------< T E S T _ Z B L >--------------------------------------------------------------
function p:test_Zbl self:preprocess_equals_preprocess_many('Title . ', 'Book: Title . ', , )end
return p