Module:mn-IPA/testcases: difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
crappy examples to test pre-punctuation and string-end environments |
respelling of монгол хэл |
||
Line 16: | Line 16: | ||
function tests:test_phonemic_IPA() |
function tests:test_phonemic_IPA() |
||
local examples = { |
local examples = { |
||
{ 'монгол хэл', ' |
{ 'монгол хэл', 'mɔŋɡəɮ xeɮ', 'монгәл хэл' }, |
||
{ 'сайн байна уу', 'saiŋ pain ʊː' }, |
{ 'сайн байна уу', 'saiŋ pain ʊː' }, |
||
{ 'сайн!', 'saiŋ!' }, |
{ 'сайн!', 'saiŋ!' }, |
Revision as of 05:50, 30 April 2019
- The following documentation is located at Module:mn-IPA/testcases/documentation. [edit] Categories were auto-generated by Module:module categorization. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • tested module • sandbox
4 of 4 tests failed. (refresh)
Text | Expected | Actual | |
---|---|---|---|
монгәл хэл – монгол хэл (mongol xel) | /mɔŋɡəɮ xeɮ/ | /ˈmɔŋkəɮ xeɮ/ | |
сайн байна уу (sajn bajna uu) | /saiŋ pain ʊː/ | /ˈsɛːm pɛːn ʊː/ | |
сайн! (sajn!) | /saiŋ!/ | /ˈsɛːŋ!/ | |
сайн (sajn) | /saiŋ/ | /ˈsɛːŋ/ |
local tests = require 'Module:UnitTests'
local to_IPA = require 'Module:mn-IPA'.to_IPA
local mn = require 'Module:languages'.getByCode 'mn'
local full_link = require 'Module:links'.full_link
local function link(text)
return full_link { term = text, lang = mn }
end
local tag_text = require 'Module:script utilities'.tag_text
local function tag(text)
return tag_text(text, mn)
end
function tests:test_phonemic_IPA()
local examples = {
{ 'монгол хэл', 'mɔŋɡəɮ xeɮ', 'монгәл хэл' },
{ 'сайн байна уу', 'saiŋ pain ʊː' },
{ 'сайн!', 'saiŋ!' },
{ 'сайн', 'saiŋ' },
}
local options = {
display = function (IPA)
return '<span class="IPA">/' .. IPA .. '/</span>'
end
}
self:iterate(examples, function (self, term, IPA, respelling)
local term_display = link(term)
if respelling then
term_display = tag(respelling) .. ' – ' .. term_display
end
self:equals(term_display, to_IPA(respelling or term), IPA, options)
end)
end
return tests