Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:YouTubeSubscribers/testcases

From Wikipedia, the free encyclopedia
local p = require('Module:UnitTests')

function p:test_YT_subCount()
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q111862397}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q24088544}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q5}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID &quot;Q999999999999&quot; is unknown to the system. Please use a valid entity ID.</span></strong>')
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCount|qid=Q4115189}}', '', {noexpectation=1})
    
end

function p:test_YT_subCountNice()
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q111862397}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q24088544}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q5}}', '', {noexpectation=1})
	self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID &quot;Q999999999999&quot; is unknown to the system. Please use a valid entity ID.</span></strong>')
	self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q4115189}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q28549924}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q1385340}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q28549924}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q1385340}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice|qid=Q739105}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice|qid=Q739105}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|subCountNice}}', '', {noexpectation=1})
    self:preprocess_equals('{{#invoke:YouTubeSubscribers/sandbox|subCountNice}}', '', {noexpectation=1})

end

function p:test_YT_date()
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q111862397}}', 'October 2025')
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q24088544}}', 'September 2025')
    self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q5}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-e171b741">Lua error in Module:YouTubeSubscribers at line 211: Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred.</span></strong>')
	self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q999999999999}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-5e455087">The ID &quot;Q999999999999&quot; is unknown to the system. Please use a valid entity ID.</span></strong>')    
	self:preprocess_equals('{{#invoke:YouTubeSubscribers|date|qid=Q4115189}}', '<strong class="error"><span class="scribunto-error mw-scribunto-error-1c89491b">Lua error in Module:YouTubeSubscribers at line 211: Could not find a single best YouTube channel ID for this item. Add a YouTube channel ID or set the rank of one channel ID to be preferred.</span></strong>')    
	
end

return p