test/test_gimchi.rb in gimchi-0.1.6 vs test/test_gimchi.rb in gimchi-0.1.7
- old
+ new
@@ -1,7 +1,8 @@
# encoding: UTF-8
+$LOAD_PATH.unshift File.dirname(__FILE__)
require 'helper'
class TestGimchi < Test::Unit::TestCase
def test_korean_char
ko = Gimchi::Korean.new
@@ -73,9 +74,12 @@
assert_raise(ArgumentError) { ch.jongsung = 'ㅠ' }
end
def test_read_number
ko = Gimchi::Korean.new
+ assert_equal "영", ko.read_number(0)
+ assert_equal "일", ko.read_number(1)
+ assert_equal "구", ko.read_number(9)
assert_equal "천 구백 구십 구", ko.read_number(1999)
assert_equal "마이너스 백점일이삼", ko.read_number(- 100.123)
assert_equal "오백 삼십 일억 구천 백 십만 육백 칠십 팔점삼이일사오육칠",
ko.read_number("53,191,100,678.3214567")
assert_equal "영점영영영영영일이삼사오", ko.read_number("1.2345e-06")