Module:ja-kana/testcases
Apparence
Tous les tests ont réussi (rafraichir)
Texte | Attendu | Obtenu | |
---|---|---|---|
あ | ア | ア |
Texte | Attendu | Obtenu | |
---|---|---|---|
eiga | e̞ː.ɡa | e̞ː.ɡa | |
eiga | nil | nil | |
eiga | e̞.i.ɡa | e̞.i.ɡa | |
eiga | e̞.i.ɡa | e̞.i.ɡa | |
sho | ɕo̞ | ɕo̞ | |
shyo | romanisation erronée | romanisation erronée |
local tests = require('Module:UnitTests')
local jakana = require('Module:ja-kana')
function tests:check_hira_kata(mot, attendu)
self:equals(mot, jakana.hira_en_kata(mot), attendu)
end
function tests:check_roman_pron(mot, attendu, certain, sans_diph)
test_str = mot
if certain then
test_str = test_str .. ' certain'
end
if sans_diph then
test_str = test_str .. ' sans_diph'
end
self:equals(mot, jakana.roman_en_pron(mot, certain, sans_diph), attendu)
end
function tests:test_hira_kana()
self:check_hira_kata('', '')
self:check_hira_kata('あ', 'ア')
end
function tests:test_roman_pron()
self:check_roman_pron('', '')
self:check_roman_pron('eiga', 'e̞ː.ɡa')
self:check_roman_pron('eiga', nil, true)
self:check_roman_pron('eiga', 'e̞.i.ɡa', nil, true)
self:check_roman_pron('eiga', 'e̞.i.ɡa', true, true)
self:check_roman_pron('sho', 'ɕo̞')
self:check_roman_pron('shyo', 'romanisation erronée')
end
return tests