[Tomoe-cvs 1707] CVS update: tomoe/test

Back to archive index

Kouhei Sutou kous****@users*****
2006年 12月 6日 (水) 15:28:37 JST


Index: tomoe/test/context_spec.rb
diff -u tomoe/test/context_spec.rb:1.23 tomoe/test/context_spec.rb:1.24
--- tomoe/test/context_spec.rb:1.23	Wed Dec  6 12:08:47 2006
+++ tomoe/test/context_spec.rb	Wed Dec  6 15:28:37 2006
@@ -110,4 +110,19 @@
       cand.char.utf8
     end.sort.should == [char.utf8, char2.utf8].sort
   end
+
+  specify "should get character by UTF8" do
+    context = Tomoe::Context.new()
+    context.load_config(@user_dict_config_file.path)
+
+    context[ucs4_to_utf8(Tomoe::Char::PRIVATE_USE_AREA_START)].should_nil
+
+    char = Tomoe::Char.new
+    char.n_strokes = 8
+    context.register(char).should
+    char.utf8.should == ucs4_to_utf8(Tomoe::Char::PRIVATE_USE_AREA_START)
+
+    retrieved_char = context[ucs4_to_utf8(Tomoe::Char::PRIVATE_USE_AREA_START)]
+    retrieved_char.n_strokes.should == char.n_strokes
+  end
 end


tomoe-cvs メーリングリストの案内
Back to archive index