Module:LangSwitch/sandbox/testcases

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

function p:test_langSwitch_without_default self:preprocess_equals_many('', {{'en', 'English'}, {'fr', 'English'}, {'co', 'Corsu'}}) self:preprocess_equals_many('', {{'en', 'English'}, {'de', 'German'},  {'gsw', 'German'}}) self:preprocess_equals_many ('', {{'en', 'English'}, {'de', 'English'},  {'gsw', 'Alemanic'}}) self:preprocess_equals_many ('', {{'en', 'English'}, {'no', 'Norwegian'},  {'de', 'English'}}) self:preprocess_equals_many ('', {{'fr', 'Vert'}, {'it', 'Verde'},  {'de', 'Grün'}}) end

function p:test_langSwitch_with_default self:preprocess_equals_many('', {{'en', 'default'}, {'it', 'Italian'}, {'co', 'Italian'}}) self:preprocess_equals_many('', {{'en', 'English'}, {'it', 'default'}, {'co', 'Corsu'}}) self:preprocess_equals_many(, {{'en', }, {'it', 'Italian'}, {'co', 'Italian'}}) self:preprocess_equals_many(, {{'en', 'English'}, {'it', }, {'co', 'Corsu'}}) self:preprocess_equals_many('', {{'en', 'English'}, {'it', 'default'}, {'co', 'Corsu'}}) self:preprocess_equals_many('', ) end

return p