| Test suite status | |
|---|---|
| Scribunto test cases | |
| Code coverage |
Unit test report for I18n.
Scribunto test cases
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:i18n|getLang}} | ⧼lang⧽ | en | 1 " " vs. "e" | |
{{#invoke:i18n|getLang|uselang=en}} | en | en | ||
{{#invoke:i18n|getLang|uselang=es}} | es | es | ||
<!-- module -->
{{#invoke:i18n|getLang}}
<!-- template -->
{{i18n|uselang=es}} | es | es | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:i18n|getMsg}} | missing arguments in i18n.getMsg | missing arguments in i18n.getMsg | ||
{{#invoke:i18n|getMsg|documentation|documentation-heading}} | Lua error: bad argument #1 to 'mw.loadJsonData' ('Module:Documentation/i18n' is not a valid JSON page). | bad argument #1 to 'mw.loadJsonData' ('Module:Documentation/i18n' is not a valid JSON page) | error | |
{{#invoke:i18n|getMsg|talk header|title}} | Lua error: bad argument #1 to 'mw.loadJsonData' ('Module:Talk header/i18n' is not a valid JSON page). | bad argument #1 to 'mw.loadJsonData' ('Module:Talk header/i18n' is not a valid JSON page) | error | |
{{#invoke:i18n|getMsg|install|css-import|uselang=en}} | @import statement | bad argument #1 to 'mw.loadJsonData' ('Module:Install/i18n' is not a valid JSON page) | error | |
{{#invoke:i18n|getMsg|install|add-to-importjs|uselang=de}} | Füge diese Zeile zu MediaWiki:ImportJS hinzu: | bad argument #1 to 'mw.loadJsonData' ('Module:Install/i18n' is not a valid JSON page) | error | |
{{#invoke:i18n|getMsg|install|title|チャット|uselang=ja}} | チャットの導入方法 | bad argument #1 to 'mw.loadJsonData' ('Module:Install/i18n' is not a valid JSON page) | error | |
{{#invoke:i18n|getMsg|common|stylesheet|2|uselang=es}} | hojas de estilo | hojas de estilo | ||
| ||||
|---|---|---|---|---|
| Status | Code | Expected | Actual | Differs at |
{{#invoke:i18n|main}} | you must specify a function to call | you must specify a function to call | ||
-- Unit tests for I18n-lua library.
-- @see Unit test report:
-- https://dev.wikia.com/wiki/Module_talk:I18n/testcases
-- @submodule
return {
getLang = {
options = {
mode = 'invocation',
preprocess = true,
nowiki = false
},
tests = {
{ nil, '{{#ifeq:{{int:lang}}|(lang)|qqx|{{int:lang}}}}' },
{ 'uselang=en', 'en' },
{ 'uselang=es', 'es' },
{ { nil, 'uselang=es' }, 'es' }
}
},
getMsg = {
options = {
mode = 'invocation',
nowiki = false
},
tests = {
{
nil,
'missing arguments in i18n.getMsg',
{ err = true }
},
{
'documentation|documentation-heading',
'{{#invoke:i18n|getMsg|documentation|documentation-heading}}',
{ pp = true }
},
{
'talk header|title',
'{{i18n|getMsg|talk header|title}}',
{ pp = true }
},
{
'install|css-import|uselang=en',
'@import statement'
},
{
'install|add-to-importjs|uselang=de',
'Füge diese Zeile zu \'\'\'MediaWiki:ImportJS\'\'\' hinzu:'
},
{
'install|title|チャット|uselang=ja',
'チャットの導入方法'
},
{
'common|stylesheet|2|uselang=es',
'hojas de estilo'
}
}
},
main = {
options = {
mode = 'invocation',
nowiki = true
},
tests = {
{ nil, 'you must specify a function to call', { err = true } }
}
}
}
-- </nowiki>