Skip to content

Commit d064be8

Browse files
committed
Address MultibyteCharsExtrasTest#test_should_compute_grapheme_length failure with Ruby 3.5.0dev
This commit addresses the following failure with Ruby 3.5.0dev since ruby/ruby@6670926 ```ruby % ruby -v ruby 3.5.0dev (2025-03-21T06:17:15Z master d868922ea8) +PRISM [arm64-darwin24] % bin/test test/multibyte_chars_test.rb -n test_should_compute_grapheme_length Running 90 tests in parallel using 10 processes Run options: -n test_should_compute_grapheme_length --seed 52859 F Failure: MultibyteCharsExtrasTest#test_should_compute_grapheme_length [test/multibyte_chars_test.rb:512]: "त्र". Expected: 2 Actual: 1 bin/test test/multibyte_chars_test.rb:595 Finished in 0.209643s, 4.7700 runs/s, 38.1601 assertions/s. 1 runs, 8 assertions, 1 failures, 0 errors, 0 skips % ``` According to ruby/ruby#12798 ,this is an expected change since Unicode 15.1.0. > As a result, an orthographic syllable in scripts like Devanagari (e.g. “क्या”, consisting of KA + VIRAMA + YA) > is now treated as a single extended grapheme cluster rather than split into two. Fix rails#54794
1 parent 82cfd9a commit d064be8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activesupport/test/multibyte_chars_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ def test_should_compute_grapheme_length
599599
["", 0],
600600
["abc", 3],
601601
["こにちわ", 4],
602-
[[0x0924, 0x094D, 0x0930].pack("U*"), 2],
602+
[[0x0924, 0x094D, 0x0930].pack("U*"), RbConfig::CONFIG["UNICODE_VERSION"] >= "15.1.0" ? 1 : 2],
603603
# GB3
604604
[%w(cr lf), 1],
605605
# GB4

0 commit comments

Comments
 (0)