diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-03 01:47:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-03 01:47:19 +0000 |
commit | 71de56621ec4643bdfee102f56a153260bb97998 (patch) | |
tree | bbcd8e099871aada7025d3127d0df128882cf9bd /test/ruby/test_string.rb | |
parent | fc1bf166964bdd5ea6c5fdac58a6f1e7e5b17afe (diff) | |
download | ruby-71de56621ec4643bdfee102f56a153260bb97998.tar.gz |
string.c: fix for non-Unicode encodings
* string.c (rb_str_enumerate_grapheme_clusters): should enumerate
chars for non-Unicode encodings. [Feature #13780]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_string.rb')
-rw-r--r-- | test/ruby/test_string.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index fb1cfdf68e..eab0c7cdd8 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -903,6 +903,7 @@ CODE assert_equal ["\u000A", "\u0308"], "\u{a 308}".each_grapheme_cluster.to_a assert_equal ["\u000D", "\u0308"], "\u{d 308}".each_grapheme_cluster.to_a + assert_equal ["a", "b", "c"], "abc".b.each_grapheme_cluster.to_a end def test_grapheme_clusters @@ -923,6 +924,7 @@ CODE assert_equal ["\u000A", "\u0308"], "\u{a 308}".grapheme_clusters assert_equal ["\u000D", "\u0308"], "\u{d 308}".grapheme_clusters + assert_equal ["a", "b", "c"], "abc".b.grapheme_clusters end def test_each_line |