update.
[chise/ruby.git] / test / test-ids.rb
index 435d2f2..c423729 100755 (executable)
@@ -43,7 +43,6 @@ class TestIDS < Test::Unit::TestCase
   end
 
   def test_decompose
-    return
     assert_equal("\342\277\261\345\256\200\345\255\220", "字".ids)
     assert_equal("⿱宀子", "字".ids)
     assert_equal(CHISE::IDC_1+"宀子", "字".ids)
@@ -72,9 +71,15 @@ class TestIDS < Test::Unit::TestCase
     assert_equal(3, de.char_length)
   end
 
-  def test_compose
-    return
+  def test_by_ids
+    cd = CHISE::ChiseDB.instance
+    byidsdb = cd.get_by_ids_db("ids")
+    assert_instance_of(CHISE::ByIDS_DB, byidsdb)
+    assert_equal(true, byidsdb.setup_db)
+    assert_equal(26519, byidsdb.decode("⿰木木"))
+  end
 
+  def test_compose
     assert_equal("⿰木木", "林".decompose)
     assert_equal("⿱木⿰木木", "森".ids)
     assert_equal("林", "⿰木木".to_ids.compose)