ruby-changes:71428
From: Koichi <ko1@a...>
Date: Wed, 16 Mar 2022 11:35:05 +0900 (JST)
Subject: [ruby-changes:71428] fc6e4ce62b (master): Allow `.0` version mismatch to pass the tests
https://git.ruby-lang.org/ruby.git/commit/?id=fc6e4ce62b From fc6e4ce62bfa95b6a0d4d4898e1128c1fce4db8a Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Wed, 16 Mar 2022 11:30:37 +0900 Subject: Allow `.0` version mismatch to pass the tests With `make update-unicode`, some tests failed with the following error due to header mismatch. * `RbConfig::CONFIG['UNICODE_EMOJI_VERSION']` => 14.0 * the header line is `# emoji-variation-sequences-14.0.0.txt` So the last `.0` is mismatch. This patch allows additional `.0` in the header line. Please revert this patch when a correct patach is merged. ``` 1) Error: TestEmojiBreaks#test_embedded_emoji: RuntimeError: File Name Mismatch: line: # emoji-variation-sequences-14.0.0.txt, expected filename: emoji-variation-sequences.txt /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:88:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:111:in `all_tests' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:127:in `test_embedded_emoji' 2) Error: TestEmojiBreaks#test_mixed_emoji: RuntimeError: File Name Mismatch: line: # emoji-variation-sequences-14.0.0.txt, expected filename: emoji-variation-sequences.txt /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:88:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:111:in `all_tests' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:139:in `test_mixed_emoji' 3) Error: TestEmojiBreaks#test_single_emoji: RuntimeError: File Name Mismatch: line: # emoji-variation-sequences-14.0.0.txt, expected filename: emoji-variation-sequences.txt /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:88:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:111:in `all_tests' /tmp/ruby/v3/src/trunk/test/ruby/enc/test_emoji_breaks.rb:117:in `test_single_emoji' ``` --- test/ruby/enc/test_emoji_breaks.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ruby/enc/test_emoji_breaks.rb b/test/ruby/enc/test_emoji_breaks.rb index cb4e2d0b6f..b3c86b0c8f 100644 --- a/test/ruby/enc/test_emoji_breaks.rb +++ b/test/ruby/enc/test_emoji_breaks.rb @@ -82,7 +82,8 @@ TestEmojiBreaks.data_files_available? and class TestEmojiBreaks https://github.com/ruby/ruby/blob/trunk/test/ruby/enc/test_emoji_breaks.rb#L82 IO.foreach(file.fullname, encoding: Encoding::UTF_8) do |line| line.chomp! if $.==1 - if line=="# #{file.basename}-#{file.version}.txt" + if line=="# #{file.basename}-#{file.version}.txt" || + line=="# #{file.basename}-#{file.version}.0.txt" version_mismatch = false elsif line!="# #{file.basename}.txt" raise "File Name Mismatch: line: #{line}, expected filename: #{file.basename}.txt" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/