i
[chise/ruby.git] / test / test-rbchise.rb
1 #!/usr/bin/env ruby
2 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
3
4 require "common"
5
6 class TestRbChise < Test::Unit::TestCase
7   def test_rbchise
8
9   end
10
11   def test_rbchise0
12     @ds = CHISE::DataSource.new
13     assert_instance_of(CHISE::DataSource, @ds)
14     @dt = @ds.open_decoding_table("=daikanwa")
15     assert_instance_of(CHISE::DecodingTable, @dt)
16     char_id = @dt.get_char(364) # get a character by Daikanwa number 364.
17     assert_instance_of(String, char_id)
18     assert_equal("?\344\273\217", char_id)
19
20     @ft = @ds.open_feature_table("ideographic-structure")
21     assert_instance_of(CHISE::FeatureTable, @ft)
22     value = @ft.get_value(char_id)
23     assert_instance_of(String, value)
24     assert_equal("(?\342\277\260 ?\344\272\273 ?\345\216\266)", value)
25   end
26 end