Kouhei Sutou
kous****@users*****
2006年 11月 30日 (木) 18:13:16 JST
Index: tomoe/test/context_spec.rb diff -u tomoe/test/context_spec.rb:1.18 tomoe/test/context_spec.rb:1.19 --- tomoe/test/context_spec.rb:1.18 Thu Nov 30 16:46:02 2006 +++ tomoe/test/context_spec.rb Thu Nov 30 18:13:15 2006 @@ -26,6 +26,6 @@ query = Tomoe::Query.new query.add_reading(Tomoe::Reading.new(Tomoe::READING_JA_KUN, "ãã")) cands = context.search(query) - cands.collect {|cand| cand.char.utf8}.should == ["æ±", "è", "è"] + cands.collect {|cand| cand.char.utf8}.sort.should == ["æ±", "è", "è"].sort end end Index: tomoe/test/tomoe-spec-utils.rb diff -u tomoe/test/tomoe-spec-utils.rb:1.15 tomoe/test/tomoe-spec-utils.rb:1.16 --- tomoe/test/tomoe-spec-utils.rb:1.15 Thu Nov 30 15:27:19 2006 +++ tomoe/test/tomoe-spec-utils.rb Thu Nov 30 18:13:15 2006 @@ -109,7 +109,7 @@ Dir.glob(File.join(test_data_dir, "*.data")) end - def make_config_file(name=nil) + def make_config_file(name=nil, use_est=false) name ||= "tomoe" config_file = Tempfile.new(name) config_file.open @@ -118,12 +118,22 @@ use_system_dictionaries = false EOC dictionaries.each_with_index do |dictionary, i| - config_file.puts(<<-EOC) + if use_est + config_file.puts(<<-EOC) +[#{File.basename(dictionary)}-dictionary] +type = est +name = #{File.basename(dictionary)} +database = #{dictionary.sub(/\.xml$/, '')} +#{(i % 2).zero? ? 'use = true' : ''} +EOC + else + config_file.puts(<<-EOC) [#{File.basename(dictionary)}-dictionary] type = xml file = #{dictionary} #{(i % 2).zero? ? 'use = true' : ''} EOC + end end config_file.close config_file