Module:Autotranslate/testcases

From Wikidata
Jump to navigation Jump to search

Documentation for this module may be created at Module:Autotranslate/testcases/doc

-- Unit tests for [[Module:Autotranslate]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_autotranslate()
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Template:Autotranslate/test | lang = en }}', '[[Template:Autotranslate/test/en]] (lang=en) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Template:Autotranslate/test | lang = fr }}', '[[Template:Autotranslate/test/en]] (lang=fr) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Template:Autotranslate/test | lang = pl }}', '[[Template:Autotranslate/test/pl]] (lang=pl) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Template:Autotranslate/test | lang = szl }}', '[[Template:Autotranslate/test/pl]] (lang=szl) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Autotranslate/test | lang = szl }}', '[[Template:Autotranslate/test/pl]] (lang=szl) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Autotranslate/test | lang = an }}', '[[Template:Autotranslate/test/es]] (lang=an) was called')
    self:preprocess_equals('{{#invoke: Autotranslate | autotranslate | base = Autotranslate/test | lang = an | text=hello | 1=arg #1 }}', '[[Template:Autotranslate/test/es]] (1=arg #1, lang=an, text=hello) was called')
end

return p