summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-16 13:26:10 +0000
committernahi <nahi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-09-16 13:26:10 +0000
commita59f05a4559ac7634bf3c8f469af69ba18070751 (patch)
tree793c1001390355019013721b3d308c722ee4b193
parent2b935b504197df01849f0e034d4111025c908092 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--test/csv/test_csv.rb16
2 files changed, 20 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index df0be30da00..cd8096e5fed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Sep 16 22:25:06 2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>
+
+ * test/csv/test_csv.rb: add negative tests of row_sep.
+
Tue Sep 16 16:47:56 2003 WATANABE Hirofumi <eban@ruby-lang.org>
* MANIFEST: add test/csv/mac.csv.
diff --git a/test/csv/test_csv.rb b/test/csv/test_csv.rb
index 41e25fe5ec4..6e95a1ba852 100644
--- a/test/csv/test_csv.rb
+++ b/test/csv/test_csv.rb
@@ -1207,12 +1207,28 @@ public
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|
rows << row.to_a
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