diff options
Diffstat (limited to 'test/net')
-rw-r--r-- | test/net/http/test_httpheader.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb index 99c47cac93..0a2c57dcb8 100644 --- a/test/net/http/test_httpheader.rb +++ b/test/net/http/test_httpheader.rb @@ -40,6 +40,13 @@ class HTTPHeaderTest < Test::Unit::TestCase @c['aaA'] = 'aaa' @c['AAa'] = 'aaa' assert_equal 2, @c.length + + @c['aaa'] = ['aaa', ['bbb', [3]]] + assert_equal 2, @c.length + assert_equal ['aaa', 'bbb', '3'], @c.get_fields('aaa') + + assert_raise(ArgumentError){ @c['foo'] = "a\nb" } + assert_raise(ArgumentError){ @c['foo'] = ["a\nb"] } end def test_AREF @@ -65,6 +72,10 @@ class HTTPHeaderTest < Test::Unit::TestCase @c.add_field 'My-Header', 'd, d' assert_equal 'a, b, c, d, d', @c['My-Header'] assert_equal ['a', 'b', 'c', 'd, d'], @c.get_fields('My-Header') + assert_raise(ArgumentError){ @c.add_field 'My-Header', "d\nd" } + @c.add_field 'My-Header', ['e', ['f', 7]] + assert_equal 'a, b, c, d, d, e, f, 7', @c['My-Header'] + assert_equal ['a', 'b', 'c', 'd, d', 'e', 'f', '7'], @c.get_fields('My-Header') end def test_get_fields |