test/test_jaso_splitter.rb in ununiga-1.0.5 vs test/test_jaso_splitter.rb in ununiga-1.1.0

- old
+ new

@@ -1,9 +1,9 @@ require 'minitest/autorun' require 'ununiga/jaso_splitter' -class JamoSplitterTest < Minitest::Unit::TestCase +class JamoSplitterTest < Minitest::Test def test_extract_chosung testgroup = { '가' => 'ㄱ', '낳' => 'ㄴ', '짷' => 'ㅉ', '하' => 'ㅎ' @@ -16,11 +16,13 @@ def test_extract_jungsung testgroup = { '가' => 'ㅏ', '내' => 'ㅐ', '찋' => 'ㅢ', - '휷' => 'ㅠ' + '휷' => 'ㅠ', + '쿄' => 'ㅛ', + '왜' => 'ㅙ' } testgroup.each do |char, jungsung| splitter = Ununiga::JasoSplitter.new(char) assert_equal jungsung, splitter.extract_jungsung end @@ -32,17 +34,22 @@ '찋' => 'ㅎ', '휷' => 'ㄳ' } testgroup.each do |char, jongsung| splitter = Ununiga::JasoSplitter.new(char) - assert_equal jongsung, splitter.extract_jongsung + if jongsung + assert_equal jongsung, splitter.extract_jongsung + else + assert_nil splitter.extract_jongsung + end end end def test_split testgroup = { '신' => ['ㅅ', 'ㅣ', 'ㄴ'], '재' => ['ㅈ', 'ㅐ', nil], - '현' => ['ㅎ', 'ㅕ', 'ㄴ'] + '현' => ['ㅎ', 'ㅕ', 'ㄴ'], + '꾢' => ['ㄲ', 'ㅛ', 'ㄶ'] } testgroup.each do |char, splitted| splitter = Ununiga::JasoSplitter.new(char) assert_equal splitted, splitter.split end