Jump to content

Modulo:Baw-ing/pangsubok

Manipud iti Wikipedia, ti nawaya nga ensiklopedia
-- Panagsubok para iti [[Modulo:Baw-ing]]. Pinduten ti tungtunganna a panid tapno maipataray ti panagsubok.

local module_name = 'Baw-ing/pagipadasan'

local p = require('Modulo:UnitTests')
 
function p:test_main()
	local options = { nowiki = true }
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|WP:VE}}', 'Wikipedia:VisualEditor', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|  WP:VE  }}', 'Wikipedia:VisualEditor', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|    }}', '', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|[[WP:VE]]|bracket=yes}}','[[Wikipedia:VisualEditor]]', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|[[WP:VE]]}}', 'Wikipedia:VisualEditor', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|  [[WP:VE]]  }}', 'Wikipedia:VisualEditor', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|WP:VE|bracket=yes}}', '[[Wikipedia:VisualEditor]]', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|main|  WP:VE  |bracket=yes}}', '[[Wikipedia:VisualEditor]]', options)
end

function p:test_canonicalisation()
	self:preprocess_equals('{{#invoke:' .. module_name .. '|main|Modulo tungtungan:Baw-ing/pagipadasan}}', 'Modulo tungtungan:Baw-ing', options) -- Content is "#REDIRECT [[Modulo tungtungan:Baw-ing]]"
end

function p:test_isRedirect()
	self:preprocess_equals('{{#invoke:' .. module_name .. '|isRedirect|WP:VE}}', 'yes', options)
    self:preprocess_equals('{{#invoke:' .. module_name .. '|isRedirect|Pransia}}', '', options)
end

return p