Prefer to use File.readlines instead of IO.readlines
This commit is contained in:
parent
ae4d8e99f1
commit
d3d8cd304f
Notes:
git
2023-02-27 09:49:46 +00:00
@ -360,7 +360,7 @@ def get_included(file)
|
|||||||
file_name = File.join dir, file
|
file_name = File.join dir, file
|
||||||
|
|
||||||
if File.exist? file_name then
|
if File.exist? file_name then
|
||||||
included = IO.readlines file_name
|
included = File.readlines file_name
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -19,7 +19,7 @@ class TestCaseFold < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def read_tests
|
def read_tests
|
||||||
IO.readlines("#{UNICODE_DATA_PATH}/CaseFolding.txt", encoding: Encoding::ASCII_8BIT)
|
File.readlines("#{UNICODE_DATA_PATH}/CaseFolding.txt", encoding: Encoding::ASCII_8BIT)
|
||||||
.collect.with_index { |linedata, linenumber| [linenumber.to_i+1, linedata.chomp] }
|
.collect.with_index { |linedata, linenumber| [linenumber.to_i+1, linedata.chomp] }
|
||||||
.reject { |number, data| data =~ /^(#|$)/ }
|
.reject { |number, data| data =~ /^(#|$)/ }
|
||||||
.collect do |linenumber, linedata|
|
.collect do |linenumber, linedata|
|
||||||
|
@ -1266,7 +1266,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||||||
begin;
|
begin;
|
||||||
class Bug < RuntimeError
|
class Bug < RuntimeError
|
||||||
def backtrace
|
def backtrace
|
||||||
IO.readlines(IO::NULL)
|
File.readlines(IO::NULL)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
bug = Bug.new '[ruby-core:85939] [Bug #14577]'
|
bug = Bug.new '[ruby-core:85939] [Bug #14577]'
|
||||||
|
@ -24,7 +24,7 @@ class TestUnicodeNormalize
|
|||||||
NormTest = Struct.new :source, :NFC, :NFD, :NFKC, :NFKD, :line
|
NormTest = Struct.new :source, :NFC, :NFD, :NFKC, :NFKD, :line
|
||||||
|
|
||||||
def self.read_tests
|
def self.read_tests
|
||||||
lines = IO.readlines(expand_filename('NormalizationTest'), encoding: 'utf-8')
|
lines = File.readlines(expand_filename('NormalizationTest'), encoding: 'utf-8')
|
||||||
firstline = lines.shift
|
firstline = lines.shift
|
||||||
define_method "test_0_normalizationtest_firstline" do
|
define_method "test_0_normalizationtest_firstline" do
|
||||||
assert_include(firstline, "NormalizationTest-#{UNICODE_VERSION}.txt")
|
assert_include(firstline, "NormalizationTest-#{UNICODE_VERSION}.txt")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user