Module:Formatted appearance/testcases
Appearance
![]() | This is the test cases page for the module Module:Formatted appearance. Results of the test cases. |
-- Unit tests for [[Module:Formatted Appearance]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_first_generic()
self:preprocess_equals_many('{{#invoke:Formatted Appearance|getFormattedAppearance|', '}}', {
{'first_appearance_major_work=Arrow', '\'\'\'Arrow\'\'\''},
{'first_appearance_minor_work=Pilot', 'Pilot'},
{'first_appearance_date=October 10, 2012', 'October 10, 2012'},
{'first_appearance_major_work=Arrow|first_appearance_minor_work=Pilot', '{{unbulleted list|\'\'\'Arrow\'\'\'|Pilot}}'},
{'first_appearance_major_work=Arrow|first_appearance_date=October 10, 2012', '{{unbulleted list|Arrow|October 10, 2012}}'},
{'first_appearance_minor_work=Pilot|first_appearance_date=October 10, 2012', '{{unbulleted list|Pilot|October 10, 2012}}'},
{'first_appearance_major_work=Arrow|first_appearance_minor_work=Pilot|first_appearance_date=October 10, 2012', '{{unbulleted list|\'\'\'Arrow\'\'\'|Pilot|October 10, 2012}}'},
{'first_appearance_major_work=[[Arrow]]|first_appearance_minor_work=[[Pilot (Arrow)|Pilot]]|first_appearance_date={{start date|2012|10|10}}', '{{unbulleted list|\'\'\'[[Arrow]]\'\'\'|[[Pilot (Arrow)|Pilot]]|{{start date|2012|10|10}}}}'},
})
end
function p:test_last_generic()
self:preprocess_equals_many('{{#invoke:Formatted Appearance|getFormattedAppearance|', '}}', {
{'last_appearance_major_work=Arrow', '\'\'\'Arrow\'\'\''},
{'last_appearance_minor_work=Pilot', 'Pilot'},
{'last_appearance_date=October 10, 2012', 'October 10, 2012'},
{'last_appearance_major_work=Arrow|last_appearance_minor_work=Pilot', '{{unbulleted list|\'\'\'Arrow\'\'\'|Pilot}}'},
{'last_appearance_major_work=Arrow|last_appearance_date=October 10, 2012', '{{unbulleted list|Arrow|October 10, 2012}}'},
{'last_appearance_minor_work=Pilot|last_appearance_date=October 10, 2012', '{{unbulleted list|Pilot|October 10, 2012}}'},
{'last_appearance_major_work=Arrow|last_appearance_minor_work=Pilot|last_appearance_date=October 10, 2012', '{{unbulleted list|\'\'\'Arrow\'\'\'|Pilot|October 10, 2012}}'},
{'last_appearance_major_work=[[Arrow]]|last_appearance_minor_work=[[Pilot (Arrow)]]|last_appearance_date={{start date|2012|10|10}}', '{{unbulleted list|\'\'\'[[Arrow]]\'\'\'|[[Pilot (Arrow)|Pilot]]|{{start date|2012|10|10}}}}'},
}, {nowiki=1})
end
function p:test_first_comic()
self:preprocess_equals_many('{{#invoke:Formatted Appearance|getFormattedAppearance|', '}}', {
{'first_appearance_major_work=The Incredible Hulk', '\'\'\'The Incredible Hulk\'\'\''},
{'first_appearance_volume=180', '#180'},
{'first_appearance_volume=#180', '#180'},
{'first_appearance_date=October, 1974', 'October, 1974'},
{'first_appearance_major_work=The Incredible Hulk|first_appearance_volume=180', '\'\'\'The Incredible Hulk\'\'\' #180'},
{'first_appearance_major_work=The Incredible Hulk|first_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\'|October, 1974}}'},
{'first_appearance_volume=180|first_appearance_date=October, 1974', '{{unbulleted list|#180|October, 1974}}'},
{'first_appearance_major_work=The Incredible Hulk|first_appearance_volume=180|first_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' #180|October, 1974}}'},
{'first_appearance_major_work=The Incredible Hulk|first_appearance_volume=Volume 180|first_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' Hulk #180|October, 1974}}'},
{'first_appearance_major_work=The Incredible Hulk|first_appearance_volume=Volume #180|first_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' #180|October, 1974}}'},
{'first_appearance_major_work=[[The Incredible Hulk (comic book)|The Incredible Hulk]]|first_appearance_volume=180|first_appearance_date={{start date|1974|10}}', '{{unbulleted list|\'\'\'[[The Incredible Hulk (comic book)|The Incredible Hulk]]\'\'\' #180|{{start date|1974|10}}}}'},
}, {nowiki=1})
end
function p:test_last_comic()
self:preprocess_equals_many('{{#invoke:Formatted Appearance|getFormattedAppearance|', '}}', {
{'last_appearance_major_work=The Incredible Hulk', '\'\'\'The Incredible Hulk\'\'\''},
{'last_appearance_volume=180', '#180'},
{'last_appearance_volume=#180', '#180'},
{'last_appearance_date=October, 1974', 'October, 1974'},
{'last_appearance_major_work=The Incredible Hulk|last_appearance_volume=180', '\'\'\'The Incredible Hulk\'\'\' #180'},
{'last_appearance_major_work=The Incredible Hulk|last_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\'|October, 1974}}'},
{'last_appearance_volume=180|last_appearance_date=October, 1974', '{{unbulleted list|#180|October, 1974}}'},
{'last_appearance_major_work=The Incredible Hulk|last_appearance_volume=180|last_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' #180|October, 1974}}'},
{'last_appearance_major_work=The Incredible Hulk|last_appearance_volume=Volume 180|last_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' #180|October, 1974}}'},
{'last_appearance_major_work=The Incredible Hulk|last_appearance_volume=Volume #180|last_appearance_date=October, 1974', '{{unbulleted list|\'\'\'The Incredible Hulk\'\'\' #180|October, 1974}}'},
{'last_appearance_major_work=[[The Incredible Hulk (comic book)|The Incredible Hulk]]|last_appearance_volume=180|last_appearance_date={{start date|1974|10}}', '{{unbulleted list|\'\'\'[[The Incredible Hulk (comic book)|The Incredible Hulk]]\'\'\' #180|{{start date|1974|10}}}}'},
}, {nowiki=1})
end
return p