mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
csv.rb: fix field_size_limit check
* lib/csv.rb (CSV#shift): the last column is an Array in extended column since r55985. [ruby-dev:49964] [Bug #13149] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9600fb38a9
commit
5bb125c63e
2 changed files with 23 additions and 1 deletions
|
@ -209,6 +209,28 @@ class TestCSV::Parsing < TestCSV
|
|||
field_size_limit: 2048 )
|
||||
end
|
||||
|
||||
def test_field_size_limit_in_extended_column_not_exceeding
|
||||
data = <<~DATA
|
||||
"a","b"
|
||||
"
|
||||
2
|
||||
",""
|
||||
DATA
|
||||
assert_nothing_raised(CSV::MalformedCSVError) do
|
||||
CSV.parse(data, field_size_limit: 4)
|
||||
end
|
||||
end
|
||||
|
||||
def test_field_size_limit_in_extended_column_exceeding
|
||||
data = <<~DATA
|
||||
"a","b"
|
||||
"
|
||||
2345
|
||||
",""
|
||||
DATA
|
||||
assert_parse_errors_out(data, field_size_limit: 5)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def assert_parse_errors_out(*args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue