summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 09:17:09 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-16 09:17:09 +0000
commit3b77cb2a64315e5bb7b2eb9af08cbca5db434ce2 (patch)
tree44ea2269669ca8c033d877e3bd36012581957fa7 /test/csv
parent59faac613f896e9f4287738c96805c96588d78c1 (diff)
Added accessor of original line when parsing.
[Feature #11865][ruby-core:72452][fix GH-1170] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_features.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb
index a558875..65ef3da 100755
--- a/test/csv/test_features.rb
+++ b/test/csv/test_features.rb
@@ -104,6 +104,20 @@ class TestCSV::Features < TestCSV
assert_equal($/, CSV.new(STDERR).row_sep)
end
+ def test_line
+ lines = [
+ %Q(abc,def\n),
+ %Q(abc,"d\nef"\n),
+ %Q(abc,"d\r\nef"\n),
+ %Q(abc,"d\ref")
+ ]
+ csv = CSV.new(lines.join(''))
+ lines.each do |line|
+ csv.shift
+ assert_equal(line, csv.line)
+ end
+ end
+
def test_lineno
assert_equal(5, @sample_data.lines.to_a.size)