Project

General

Profile

Bug #14363 » each_grapheme_cluster_size_nil.patch

hugopeixoto (Hugo Peixoto), 03/21/2018 04:17 PM

View differences:

string.c
static VALUE
rb_str_each_grapheme_cluster(VALUE str)
{
RETURN_SIZED_ENUMERATOR(str, 0, 0, rb_str_each_char_size);
RETURN_ENUMERATOR(str, 0, 0);
return rb_str_enumerate_grapheme_clusters(str, 0);
}
test/ruby/test_string.rb
assert_equal ["a", "b", "c"], "abc".b.each_grapheme_cluster.to_a
s = ("x"+"\u{10ABCD}"*250000)
assert_empty(s.each_grapheme_cluster {s.clear})
assert_nil "\u{20 200d}".each_grapheme_cluster.size
assert_nil "\u{a 308}".each_grapheme_cluster.size
end
def test_grapheme_clusters
(1-1/2)