mirror of
https://github.com/ruby/ruby.git
synced 2025-08-24 21:44:30 +02:00
Merge csv-3.0.0 from ruby/csv repository.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
21ce539f20
commit
60ebd4e26a
11 changed files with 148 additions and 106 deletions
|
@ -148,13 +148,13 @@ class TestCSV::Parsing < TestCSV
|
|||
CSV.parse_line("1,2\r,3", row_sep: "\n")
|
||||
end
|
||||
|
||||
bad_data = <<-END_DATA.gsub(/^ +/, "")
|
||||
line,1,abc
|
||||
line,2,"def\nghi"
|
||||
bad_data = <<-CSV
|
||||
line,1,abc
|
||||
line,2,"def\nghi"
|
||||
|
||||
line,4,some\rjunk
|
||||
line,5,jkl
|
||||
END_DATA
|
||||
line,4,some\rjunk
|
||||
line,5,jkl
|
||||
CSV
|
||||
lines = bad_data.lines.to_a
|
||||
assert_equal(6, lines.size)
|
||||
assert_match(/\Aline,4/, lines.find { |l| l =~ /some\rjunk/ })
|
||||
|
@ -172,13 +172,13 @@ class TestCSV::Parsing < TestCSV
|
|||
|
||||
assert_raise(CSV::MalformedCSVError) { CSV.parse_line('1,2,"3...') }
|
||||
|
||||
bad_data = <<-END_DATA.gsub(/^ +/, "")
|
||||
line,1,abc
|
||||
line,2,"def\nghi"
|
||||
bad_data = <<-CSV
|
||||
line,1,abc
|
||||
line,2,"def\nghi"
|
||||
|
||||
line,4,8'10"
|
||||
line,5,jkl
|
||||
END_DATA
|
||||
line,4,8'10"
|
||||
line,5,jkl
|
||||
CSV
|
||||
lines = bad_data.lines.to_a
|
||||
assert_equal(6, lines.size)
|
||||
assert_match(/\Aline,4/, lines.find { |l| l =~ /8'10"/ })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue