From b6ef55a23b5a63a8b9f05ed50265bf062a88547f Mon Sep 17 00:00:00 2001 From: shugo Date: Thu, 19 Nov 2009 13:56:23 +0000 Subject: * lib/net/imap.rb (flag_list): untaint strings to intern in the safe level 1. * lib/net/imap.rb (max_flag_count=): new methods to set the max number of flags interned to symbols. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/net/imap/test_imap_response_parser.rb | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/net/imap/test_imap_response_parser.rb (limited to 'test/net') diff --git a/test/net/imap/test_imap_response_parser.rb b/test/net/imap/test_imap_response_parser.rb new file mode 100644 index 000000000..5c122dd59 --- /dev/null +++ b/test/net/imap/test_imap_response_parser.rb @@ -0,0 +1,54 @@ +require "net/imap" +require "test/unit" + +class IMAPResponseParserTest < Test::Unit::TestCase + def setup + @do_not_reverse_lookup = Socket.do_not_reverse_lookup + Socket.do_not_reverse_lookup = true + @max_flag_count = Net::IMAP.max_flag_count + Net::IMAP.max_flag_count = 3 + end + + def teardown + Socket.do_not_reverse_lookup = @do_not_reverse_lookup + Net::IMAP.max_flag_count = @max_flag_count + end + + def test_flag_list_safe + parser = Net::IMAP::ResponseParser.new + response = lambda { + $SAFE = 1 + parser.parse(<