зеркало из https://github.com/github/ruby.git
Deal with Unicode ranges in the file emoji-sequences.txt
Detect Unicode ranges and loop over them. This fixes issue #18028.
This commit is contained in:
Родитель
c3d31377b3
Коммит
26b1e6fca8
|
@ -0,0 +1 @@
|
|||
../goruby
|
|
@ -0,0 +1 @@
|
|||
../ruby
|
|
@ -0,0 +1 @@
|
|||
../libruby.so.3.1.0
|
|
@ -84,7 +84,16 @@ TestEmojiBreaks.data_files_available? and class TestEmojiBreaks
|
|||
raise "File Name Mismatch: line: #{line}, expected filename: #{file.basename}.txt" if $.==1 and not line=="# #{file.basename}.txt"
|
||||
version_mismatch = false if line =~ /^# Version: #{file.version}/
|
||||
next if /\A(#|\z)/.match? line
|
||||
file_tests << BreakTest.new(file.basename, $., *line.split('#')) rescue 'whatever'
|
||||
if line =~ /^(\h{4,6})\.\.(\h{4,6}) *(;.+)/ # deal with Unicode ranges in emoji-sequences.txt (Bug #18028)
|
||||
range_start = $1.to_i(16)
|
||||
range_end = $2.to_i(16)
|
||||
rest = $3
|
||||
(range_start..range_end).each do |code_point|
|
||||
file_tests << BreakTest.new(file.basename, $., *(code_point.to_s(16)+rest).split('#')) rescue 'whatever'
|
||||
end
|
||||
else
|
||||
file_tests << BreakTest.new(file.basename, $., *line.split('#')) rescue 'whatever'
|
||||
end
|
||||
end
|
||||
raise "File Version Mismatch: file: #{file.fullname}, version: #{file.version}" if version_mismatch
|
||||
tests += file_tests
|
||||
|
|
Загрузка…
Ссылка в новой задаче