| local p = require('Modulo:UnitTests')   function p:test_webserietest_categorie_webserie() 	self:preprocess_equals_many("{{#invoke:FictionTV|categorie_anno|debug=1|", "}}", {
 		-- webserie non è attualmente categorizzata per anno 
 		{ 'tipofiction=webserie|annoprimatv=[[2010]]', '' },
 		-- il wikilink è obbligatorio
 		{ 'tipofiction=webserie|annoprimatv=2010', '[[:Categoria:Errori di compilazione del template FictionTV]]' },
 	})
 end
  
 function p:test_miniserie_TV()
 	self:preprocess_equals_many("{{#invoke:FictionTV|categorie_anno|debug=1|", "}}", {
 		{ 'tipofiction=miniserie TV|annoprimatv=[[2010]]', '[[:Categoria:Miniserie televisive del 2010]]' },
 		-- il wikilink è obbligatorio
 		{ 'tipofiction=miniserie TV|annoprimatv=2010', '[[:Categoria:Errori di compilazione del template FictionTV]]' },
 	})
 end
  
 function p:test_film_TV()
 	self:preprocess_equals_many("{{#invoke:FictionTV|categorie_anno|debug=1|", "}}", {
 		{ 'tipofiction=film TV|annoprimatv=[[2010]]', '[[:Categoria:Film per la televisione del 2010]]' },
 		-- il wikilink è obbligatorio
 		{ 'tipofiction=film TV|annoprimatv=2010', '[[:Categoria:Errori di compilazione del template FictionTV]]' }
 	})
 end
  
 function p:test_serie_TV()
 	self:preprocess_equals_many("{{#invoke:FictionTV|categorie_anno|debug=1|", "}}", {
 		-- anno singolo
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]]', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive terminate nel 2010]]' },
 		-- il wikilink è obbligatorio
 		{ 'tipofiction=serie TV|annoprimatv=2010', '[[:Categoria:Errori di compilazione del template FictionTV]]' },
 		-- con intervallo, usando il trattino (U+002D) con e senza spazi
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]]-[[2011]]', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive terminate nel 2011]]' },
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] - [[2011]]', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive terminate nel 2011]]' },
 		-- con intervallo, usando la lineetta enne (U+2013) con e senza spazi
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]]–[[2011]]', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive terminate nel 2011]]' },
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] – [[2011]]', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive terminate nel 2011]]' },
 		-- con "in produzione" con il trattino (U+002D) o la lineetta enne (U+2013)
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] - in produzione', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive in produzione]]' },	
 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] – in produzione', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive in produzione]]' }
 	})
 end
  
 function p:test_serial_TV()
 	self:preprocess_equals_many("{{#invoke:FictionTV|categorie_anno|debug=1|", "}}", {
 		-- anno singolo
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]]', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi terminati nel 2010]]' },
 		-- il wikilink è obbligatorio
 		{ 'tipofiction=serial TV|annoprimatv=2010', '[[:Categoria:Errori di compilazione del template FictionTV]]' },
 		-- con intervallo, usando il trattino (U+002D) con e senza spazi
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]]-[[2011]]', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi terminati nel 2011]]' },
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]] - [[2011]]', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi terminati nel 2011]]' },
 		-- con intervallo, usando la lineetta enne (U+2013) con e senza spazi
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]]–[[2011]]', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi terminati nel 2011]]' },
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]] – [[2011]]', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi terminati nel 2011]]' },
 		-- con "in produzione" con il trattino (U+002D) o la lineetta enne (U+2013)
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]] - in produzione', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi in produzione]]' },		
 		{ 'tipofiction=serial TV|annoprimatv=[[2010]] – in produzione', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi in produzione]]' }
 	})
 end
  
 --TEST sandbox
 ----PARTE 1: ripetizione test casi sopra con codice aggiornato
 function p:test_webserie()
 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|categorie_anno|debug=1|", "}}", { 		-- webserie non è attualmente categorizzata per anno  		{ 'tipofictiontipo fiction=webserie|annoprimatvanno prima visione=[[2010]]', '[[2010]]' }, 	}) end   function p:test_miniserie_TVtest_categorie_miniserie_TV() 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|categorie_anno|debug=1|", "}}", { 		{ 'tipofictiontipo fiction=miniserie TV|annoprimatvanno prima visione=[[2010]]','[[:Categoria:Miniserie televisive del 2010]]<br />'
 },.. 		  '[[2010]]' 		}, 		-- il wikilink non è obbligatorio 		{ 'tipofictiontipo fiction=miniserie TV|annoprimatvanno prima visione=2010','[[:Categoria:Miniserie televisive del 2010]]<br />'
 },.. 		  '[[2010]]' 		}, 	}) end   function p:test_film_TVtest_categorie_film_TV() 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|categorie_anno|debug=1|", "}}", { 		{ 'tipofictiontipo fiction=film TV|annoprimatvanno prima visione=[[2010]]', '[[:Categoria:Film per la televisione del 2010]]<br />[[2010]]' }, 		-- il wikilink non è obbligatorio 		{ 'tipofictiontipo fiction=film TV|annoprimatvanno prima visione=2010', '[[:Categoria:Film per la televisione del 2010]]<br />[[2010]]' }, 	}) end   function p:test_serie_TVtest_categorie_serie_TV() 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|categorie_anno|debug=1|", "}}", { 		-- anno singolo 		{ 'tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]]','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2010]]<br />'
 },.. 		   '[[2010]]' 		}, 		-- il wikilink non è obbligatorio 		{ 'tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=2010','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2010]]<br />'
 },.. 		  '[[2010]]' 		}, 		-- con intervallo, usando il trattino (U+002D) con e senza spazi 		{ 'tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]]-[[2011]]','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]'},
 { '
 tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]] - [[2011]]','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]' 		}, 		-- con intervallo, usando la lineetta enne (U+2013) con e senza spazi 		{ 'tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]]–[[2011]]','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2011]]<br />'
 },.. 		   '[[2010]]-[[2011]]'},
 { '
 tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]] – [[2011]]','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive terminate nel 2011]]<br />'
 },.. 		   '[[2010]]-[[2011]]' 		}, 		-- con "in produzione" con il trattino (U+002D) o la lineetta enne (U+2013) 		{ 'tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]] - in produzione','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive in produzione]]<br />'
 },	.. 		  '[[2010]] – in produzione'},
 { '
 tipofictiontipo fiction=serie TV|annoprimatvanno prima visione=[[2010]] – in produzione','[[:Categoria:Serie televisive iniziate nel 2010]]<br />' ..
 '[[:Categoria:Serie televisive in produzione]]<br />'
 },.. 		  '[[2010]] – in produzione' 			-- con "in corso" con il trattino (U+002D) o la lineetta enne (U+2013)
 		}, 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] - in corso', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive in produzione]]' },	
 		-- con "in corso" con il trattino (U+002D) o la lineetta enne (U+2013) 		{ 'tipofiction=serie TV|annoprimatv=[[2010]] – in corso', '[[:Categoria:Serie televisive iniziate nel 2010]] [[:Categoria:Serie televisive in produzione]]' },
 		{ 'tipo fiction=serie TV|anno prima visione=[[2010]] - in corso', 		   '[[:Categoria:Serie televisive iniziate nel 2010]]<br />' .. 		   '[[:Categoria:Serie televisive in produzione]]<br />' .. 		   '[[2010]] – in produzione' 		}, 		{ 'tipo fiction=serie TV|anno prima visione=[[2010]] – in corso', 		  '[[:Categoria:Serie televisive iniziate nel 2010]]<br />' .. 		  '[[:Categoria:Serie televisive in produzione]]<br />' .. 		  '[[2010]] – in produzione' 		}, 		-- con "serie tv" minuscolo 		{ 'tipo fiction=serie tv|anno prima visione=[[2010]] - in corso', 		   '[[:Categoria:Serie televisive iniziate nel 2010]]<br />' .. 		   '[[:Categoria:Serie televisive in produzione]]<br />' .. 		   '[[2010]] – in produzione' 		}, 		{ 'tipo fiction=serie tv|anno prima visione=[[2010]] – in corso', 		  '[[:Categoria:Serie televisive iniziate nel 2010]]<br />' .. 		  '[[:Categoria:Serie televisive in produzione]]<br />' ..  		  '[[2010]] – in produzione' 		}, 		-- varianti errate 		{ 'tipo fiction=serie TV|anno prima visione=2010 e 2012', 		  '[[:Categoria:Errori di compilazione del template FictionTV]]<br />' 		}, 		{ 'tipo fiction=serie TV|anno prima visione=2010, 2012', 		  '[[:Categoria:Errori di compilazione del template FictionTV]]<br />' 		}, 		-- controllo limiti 		{ 'tipo fiction=serie tv|anno prima visione=[[1800]]–[[2010]]', 		  '[[:Categoria:Errori di compilazione del template FictionTV]]<br />' ..  		  '[[1800]]-[[2010]]' 		}, 		{ 'tipo fiction=serie tv|anno prima visione=[[1800]] – in produzione', 		  '[[:Categoria:Errori di compilazione del template FictionTV]]<br />' ..  		  '[[1800]] – in produzione' 		}, 		{ 'tipo fiction=serie tv|anno prima visione=[[2010]]–[[2090]]', 		  '[[:Categoria:Errori di compilazione del template FictionTV]]<br />' ..  		  '[[2010]]-[[2090]]' 		} 	}) end   function p:test_serial_TVtest_categorie_serial_TV() 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|categorie_anno|debug=1|", "}}", { 		-- anno singolo 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]]','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2010]]<br />'
 },.. 		  '[[2010]]' 		}, 		-- il wikilink non è obbligatorio 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=2010','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2010]]<br />'
 },.. 		  '[[2010]]' 		}, 		-- con intervallo, usando il trattino (U+002D) con e senza spazi 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]]-[[2011]]','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]'},
 { '
 tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]] - [[2011]]','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]' 		}, 		-- con intervallo, usando la lineetta enne (U+2013) con e senza spazi 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]]–[[2011]]','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]'},
 { '
 tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]] – [[2011]]','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi terminati nel 2011]]<br />'
 },.. 		  '[[2010]]-[[2011]]' 		}, 		-- con "in produzione" con il trattino (U+002D) o la lineetta enne (U+2013) 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]] - in produzione', '[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi in produzione]]<br />'
 },		.. 		'[[2010]] – in produzione'},
 { '
 tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]] – in produzione','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />'..
 '[[:Categoria:Serial televisivi in produzione]]<br />'
 },.. 		  '[[2010]] – in produzione' 		}, 		-- con "in corso" con il trattino (U+002D) o la lineetta enne (U+2013) 		{ 'tipofictiontipo fiction=serial TV|annoprimatvanno prima visione=[[2010]] - in corso','[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' ..
 '[[:Categoria:Serial televisivi in produzione]]<br />'
 },		.. 		  '[[2010]] – in produzione' 		{ 'tipofiction=serial TV|annoprimatv=[[2010]] – in corso', '[[:Categoria:Serial televisivi iniziati nel 2010]] [[:Categoria:Serial televisivi in produzione]]' }
 		}, 		{ 'tipo fiction=serial TV|anno prima visione=[[2010]] – in corso', 		  '[[:Categoria:Serial televisivi iniziati nel 2010]]<br />' .. 		  '[[:Categoria:Serial televisivi in produzione]]<br />' .. 		  '[[2010]] – in produzione' 		} 	}) end  
 ----PARTE 2: test nuova funzione
 function p:test_visualizzazioneanno()
 	self:preprocess_equals_many("{{#invoke:FictionTV/sandbox|visualizzazione_anno|debug=1|", "}}", {
 		-- anno singolo
 		{ 'annoprimatv=[[2010]]', '[[2010]]' },
 		-- il wikilink non è obbligatorio
 		{ 'annoprimatv=2010', '[[2010]]' },
 		-- con intervallo, usando il trattino (U+002D) con e senza spazi
 		{ 'annoprimatv=[[2010]]-[[2011]]', '[[2010]]-[[2011]]' },
 		{ 'annoprimatv=[[2010]] - [[2011]]', '[[2010]]-[[2011]]' },
 		-- con intervallo, usando la lineetta enne (U+2013) con e senza spazi
 		{ 'annoprimatv=[[2010]]–[[2011]]', '[[2010]]-[[2011]]' },
 		{ 'annoprimatv=[[2010]] – [[2011]]', '[[2010]]-[[2011]]' },
 		-- con "in produzione" con il trattino (U+002D) o la lineetta enne (U+2013)
 		{ 'annoprimatv=[[2010]] - in produzione', '[[2010]] – in produzione' },
 		{ 'annoprimatv=[[2010]] – in produzione', '[[2010]] – in produzione' },
 		-- con "in corso" con il trattino (U+002D) o la lineetta enne (U+2013)
 		{ 'annoprimatv=[[2010]] - in corso', '[[2010]] – in produzione' },
 		{ 'annoprimatv=[[2010]] – in corso', '[[2010]] – in produzione' },
 	})
 end
  
   return p |