Module:Autotranslate/testcases

From "PTTLink Wiki"
< Module:Autotranslate
Revision as of 13:07, 25 May 2018 by Mediawiki>Jarekt
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

no documentation yet


-- 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