From a59f05a4559ac7634bf3c8f469af69ba18070751 Mon Sep 17 00:00:00 2001 From: nahi Date: Tue, 16 Sep 2003 13:26:10 +0000 Subject: * test/csv/test_csv.rb: add negative tests of row_sep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/csv/test_csv.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test/csv/test_csv.rb') diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb index 41e25fe5ec..6e95a1ba85 100644 --- a/test/csv/test_csv.rb +++ b/test/csv/test_csv.rb @@ -1206,6 +1206,13 @@ public end assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows) + rows = [] + assert_raises(CSV::IllegalFormatError) do + CSV.open(@macfile, "r") do |row| + rows << row.to_a + end + end + rows = [] file = File.open(@macfile) CSV::Reader.parse(file.read, ?,, ?\r) do |row| @@ -1213,6 +1220,15 @@ public end assert_equal([["Avenches", "aus Umgebung"], ["Bad Hersfeld", "Ausgrabung"]], rows) file.close + + rows = [] + file = File.open(@macfile) + assert_raises(CSV::IllegalFormatError) do + CSV::Reader.parse(file.read, ?,) do |row| + rows << row.to_a + end + end + file.close end -- cgit v1.2.3