diff options
author | Koichi Sasada <ko1@atdot.net> | 2022-03-16 11:30:37 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2022-03-16 11:30:37 +0900 |
commit | fc6e4ce62bfa95b6a0d4d4898e1128c1fce4db8a (patch) | |
tree | 91871d19a9bf9982e1ea6cf0330c857ab26c1c38 /test | |
parent | 5d90c6010999ac11d25822f13f0b29d377f81755 (diff) |
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'
```
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/enc/test_emoji_breaks.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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 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" |