[4163] MacRuby/trunk/spec/frozen/core/string/shared/codepoints.rb
Revision: 4163 http://trac.macosforge.org/projects/ruby/changeset/4163 Author: eloy.de.enige@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
participants (1)
-
source_changes@macosforge.org