[macruby-changes] [4163] MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb

source_changes at macosforge.org source_changes at macosforge.org
Wed May 26 13:30:29 PDT 2010


Revision: 4163
          http://trac.macosforge.org/projects/ruby/changeset/4163
Author:   eloy.de.enige at gmail.com
Date:     2010-05-26 13:30:25 -0700 (Wed, 26 May 2010)
Log Message:
-----------
Add spec about String#each_codepoint for characters outside the BMP.

Modified Paths:
--------------
    MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb

Modified: MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb
===================================================================
--- MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb	2010-05-26 19:58:42 UTC (rev 4162)
+++ MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb	2010-05-26 20:30:25 UTC (rev 4163)
@@ -47,6 +47,12 @@
     s.send(@method).to_a.should == [38937]
   end
 
+  it "works for characters outside of the BMP" do
+    s = "\u{10346}"
+    s.force_encoding(Encoding::UTF_8)
+    s.send(@method).to_a.should == [66374]
+  end
+
   it "returns the codepoint corresponding to the character's position in the String's encoding" do
     "\u{787}".send(@method).to_a.should == [1927]
   end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100526/d3cfd966/attachment.html>


More information about the macruby-changes mailing list