-#class TC_DB < Test::Unit::TestCase
-class TestDataBase
- def setup
- @cdb = CHISE::CharDB.instance
- @sdb = CHISE::CodesysDB.instance
- end
-
- def test_db
- assert_equal("()+!", CHISE::DB.unix_to_win("<>*?"))
- assert_equal("<>*?", CHISE::DB.win_to_unix("()+!"))
- end
-
- def test_each_db(db)
- assert_instance_of(Array, db.keys)
- end
-
- def test_make_db(db)
- h = {"a" => 1, "b" => 2, "c" => 3}
- db.remove_db("test-db") #\82Ü\82¸\8dÅ\8f\89\82É\8fÁ\82µ\82Ä\82¨\82
- assert_not_nil(db.make_db("test-db", h))
- assert_not_nil(db.open_db("test-db"))
- assert_equal(1, db.get("test-db", "a"))
- assert_equal(2, db.get("test-db", "b"))
- assert_equal(3, db.get("test-db", "c"))
- db.remove_db("test-db") #\8dÅ\8cã\82É\82Ü\82½\8fÁ\82µ\82Ä\82¨\82
- end
-
- def test_dbs
- test_each_db(@cdb)
- test_each_db(@sdb)
-# test_make_db(@cdb)
-# test_make_db(@sdb)
- end
-
- def test_db_put
- char = "\8e\9a".char
- char.put_char_attribute("test-attribute", "test")
- assert_equal("test", char.test_attribute)
- end
-
-end
-