From d57bc03ba98649661c7dedbb46ec2f2bb6bee9be Mon Sep 17 00:00:00 2001 From: Mike MacDonald Date: Sat, 2 Nov 2019 23:48:22 -0400 Subject: [ruby/csv] Do not loop forever when skip_lines regexp matches zero length with anchors (#110) * Do not loop forever when skip_lines regexp matches zero length with anchors * Remove needless white spaces * Add missing eos check in skip_needless_lines * Simplify test https://github.com/ruby/csv/commit/3b15d4a3e8 --- test/csv/parse/test_skip_lines.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/csv/parse') diff --git a/test/csv/parse/test_skip_lines.rb b/test/csv/parse/test_skip_lines.rb index 196858f1b0..2f7e6c8ddd 100644 --- a/test/csv/parse/test_skip_lines.rb +++ b/test/csv/parse/test_skip_lines.rb @@ -102,4 +102,11 @@ class TestCSVParseSkipLines < Test::Unit::TestCase :skip_lines => /\A#/)) end end + + def test_empty_line_and_liberal_parsing + assert_equal([["a", "b"]], + CSV.parse("a,b\n", + :liberal_parsing => true, + :skip_lines => /^$/)) + end end -- cgit v1.2.3