n.c.
[chise/ruby.git] / test / test-ids.rb
index 3c0e98c..e850450 100755 (executable)
@@ -2,8 +2,9 @@
 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
 
 require "common"
+require "chise/ids"
 
-class TestIDS < Test::Unit::TestCase
+class TestIDC < Test::Unit::TestCase
   def test_idc
     char = CHISE::Character.get(0x2FF0)
     assert_equal("IDEOGRAPHIC DESCRIPTION CHARACTER LEFT TO RIGHT", char.name)
@@ -11,3 +12,24 @@ class TestIDS < Test::Unit::TestCase
     assert_equal(char.bidi_category, "ON")
   end
 end
+
+class TestIDS < Test::Unit::TestCase
+  def test_ids_1
+    assert_equal("\342\277\261\345\256\200\345\255\220", "字".ids)
+    assert_equal("⿱宀子", "字".ids)
+    assert_equal(CHISE::IDC_1+"宀子", "字".ids)
+    assert_equal("\342\277\260\346\227\245\345\257\272", "時".ids)
+    assert_equal(CHISE::IDC_0+"日寺", "時".ids)
+  end
+
+  def test_decompose
+    char = "榊".char
+    assert_equal("⿰木神", char.ids)
+    assert_equal("⿰木神", char.decompose)
+#    assert_equal("⿰木神", char.decompose_all)
+
+
+
+
+  end
+end