mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/csv.rb: Fixed a bug in read_to_char() that would slurp
whole files if the encoding was invalid. It will now read up to 10 bytes ahead to find a valid character boundary or give up. [ruby-core:19465] * test/csv/test_features.rb, test/csv/test_table.rb, test/csv/test_row.rb: Loosened some tests to check for a compatible? Encoding instea of an exact Encoding. [ruby-core:19470] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7222e82a8b
commit
dfda5877ca
5 changed files with 33 additions and 14 deletions
|
@ -250,9 +250,11 @@ class TestCSVFeatures < Test::Unit::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
def test_inspect_is_ascii_8bit_encoded
|
||||
def test_inspect_encoding_is_ascii_compatible
|
||||
CSV.new("one,two,three\n1,2,3\n".encode("UTF-16BE")) do |csv|
|
||||
assert_equal("ASCII-8BIT", csv.inspect.encoding.name)
|
||||
assert( Encoding.compatible?( Encoding.find("US-ASCII"),
|
||||
csv.inspect.encoding ),
|
||||
"inspect() was not ASCII compatible." )
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue