summaryrefslogtreecommitdiff
path: root/test/csv
diff options
context:
space:
mode:
authorjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-20 14:38:21 +0000
committerjeg2 <jeg2@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-20 14:38:21 +0000
commit3fb752a921a56fb4ea3188fb12f02f6a5749480e (patch)
treecb7adb54a4e7ef4c1b9267a2856d642fa46a265c /test/csv
parent3e20c50d509708bc0c0dedb02ec8dbfbfe1ac301 (diff)
* lib/csv.rb: Fixed a broken regular expression that was causing
CSV to miss escaping some special meaning characters when used in parsing. Reported by David Unric [ruby-core:54986] [Bug #8405] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/csv')
-rwxr-xr-xtest/csv/test_features.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/csv/test_features.rb b/test/csv/test_features.rb
index a83fff8..ad7e44d 100755
--- a/test/csv/test_features.rb
+++ b/test/csv/test_features.rb
@@ -74,6 +74,14 @@ class TestCSV::Features < TestCSV
end
end
+ def test_bug_8405
+ TEST_CASES.each do |test_case|
+ assert_equal( test_case.last.map { |t| t.tr('"', "|") unless t.nil? },
+ CSV.parse_line( test_case.first.tr('"', "|"),
+ quote_char: "|" ) )
+ end
+ end
+
def test_csv_char_readers
%w[col_sep row_sep quote_char].each do |reader|
csv = CSV.new("abc,def", reader.to_sym => "|")