summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-21 08:15:56 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-21 08:15:56 +0000
commit90ad5e369977eb45ecbe13c2411d0caf2540f1d5 (patch)
tree3670da8f728dc4ee802c904074c9fb97eb782849 /test/net
parentd3125e3e43d39d847c766f0f56e6a1e9501694ea (diff)
* lib/net/imap.rb (decode_utf7): use pack("U*") to encode UTF-8.
* lib/net/imap.rb (encode_utf7): use unpack("U*") to decode UTF-8. * test/net/imap/test_imap.rb: added tests for Net::IMAP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/imap/test_imap.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/net/imap/test_imap.rb b/test/net/imap/test_imap.rb
new file mode 100644
index 0000000..aa42152
--- /dev/null
+++ b/test/net/imap/test_imap.rb
@@ -0,0 +1,14 @@
+require "net/imap"
+require "test/unit"
+
+class IMAPTest < Test::Unit::TestCase
+ def test_encode_utf7
+ s = Net::IMAP.encode_utf7("\357\274\241\357\274\242\357\274\243")
+ assert_equal("&,yH,Iv8j-", s)
+ end
+
+ def test_decode_utf7
+ s = Net::IMAP.decode_utf7("&,yH,Iv8j-")
+ assert_equal("\357\274\241\357\274\242\357\274\243", s)
+ end
+end