summaryrefslogtreecommitdiff
path: root/test/ruby/enc
diff options
context:
space:
mode:
authorKazuhiro NISHIYAMA <zn@mbf.nifty.com>2022-03-14 08:55:45 +0900
committerKazuhiro NISHIYAMA <zn@mbf.nifty.com>2022-03-14 08:57:06 +0900
commit3c59913a05ba73f1eeadc7fbff3f55185fef2713 (patch)
tree0426de89cede91fa5d3716b4e1c7fd0831413a69 /test/ruby/enc
parent267f0089d3255c1f06ab5adf9f6c77b1ccfd2771 (diff)
Fix failures
http://ci.rvm.jp/results/trunk-no-mjit@phosphorus-docker/3870646 ``` 1) 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-no-mjit/test/ruby/enc/test_emoji_breaks.rb:84:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:105:in `all_tests' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:111:in `test_single_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-no-mjit/test/ruby/enc/test_emoji_breaks.rb:84:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:105:in `all_tests' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:133:in `test_mixed_emoji' 3) 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-no-mjit/test/ruby/enc/test_emoji_breaks.rb:84:in `block (2 levels) in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `foreach' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:82:in `block in read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `each' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:79:in `read_data' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:105:in `all_tests' /tmp/ruby/v3/src/trunk-no-mjit/test/ruby/enc/test_emoji_breaks.rb:121:in `test_embedded_emoji' make: *** [uncommon.mk:823: yes-test-all] Error 3 ```
Diffstat (limited to 'test/ruby/enc')
-rw-r--r--test/ruby/enc/test_emoji_breaks.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/ruby/enc/test_emoji_breaks.rb b/test/ruby/enc/test_emoji_breaks.rb
index 0aad14e75b..f1eed2a234 100644
--- a/test/ruby/enc/test_emoji_breaks.rb
+++ b/test/ruby/enc/test_emoji_breaks.rb
@@ -56,7 +56,7 @@ class TestEmojiBreaks < Test::Unit::TestCase
EMOJI_DATA_FILES = %w[emoji-sequences emoji-test emoji-zwj-sequences].map do |basename|
BreakFile.new(basename, EMOJI_DATA_PATH, EMOJI_VERSION)
end
- UNICODE_DATA_FILE = BreakFile.new('emoji-variation-sequences', UNICODE_DATA_PATH, UNICODE_VERSION[0..-3]) # [0..-3] deals with a versioning mismatch problem in Unicode
+ UNICODE_DATA_FILE = BreakFile.new('emoji-variation-sequences', UNICODE_DATA_PATH, UNICODE_VERSION)
EMOJI_DATA_FILES << UNICODE_DATA_FILE
def self.data_files_available?
@@ -81,7 +81,13 @@ TestEmojiBreaks.data_files_available? and class TestEmojiBreaks
file_tests = []
IO.foreach(file.fullname, encoding: Encoding::UTF_8) do |line|
line.chomp!
- raise "File Name Mismatch: line: #{line}, expected filename: #{file.basename}.txt" if $.==1 and not line=="# #{file.basename}.txt"
+ if $.==1
+ if line=="# #{file.basename}-#{file.version}.txt"
+ version_mismatch = false
+ elsif line!="# #{file.basename}.txt"
+ raise "File Name Mismatch: line: #{line}, expected filename: #{file.basename}.txt"
+ end
+ end
version_mismatch = false if line =~ /^# Version: #{file.version}/
next if line.match?(/\A(#|\z)/)
if line =~ /^(\h{4,6})\.\.(\h{4,6}) *(;.+)/ # deal with Unicode ranges in emoji-sequences.txt (Bug #18028)