summaryrefslogtreecommitdiff
path: root/test/csv/parse
diff options
context:
space:
mode:
authorMike MacDonald <crazymykl@gmail.com>2019-11-02 23:48:22 -0400
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-07-20 02:32:49 +0900
commitd57bc03ba98649661c7dedbb46ec2f2bb6bee9be (patch)
tree72fa6a8348b20e640eac893344209cf9d0700f86 /test/csv/parse
parentb219cd5ac36ffb733e3eccd98d53ecf660dee5bf (diff)
[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
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3332
Diffstat (limited to 'test/csv/parse')
-rw-r--r--test/csv/parse/test_skip_lines.rb7
1 files changed, 7 insertions, 0 deletions
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