summaryrefslogtreecommitdiff
path: root/test/openssl/test_x509name.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_x509name.rb')
-rw-r--r--test/openssl/test_x509name.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/openssl/test_x509name.rb b/test/openssl/test_x509name.rb
index 2d92e645be6..aca2d36fb04 100644
--- a/test/openssl/test_x509name.rb
+++ b/test/openssl/test_x509name.rb
@@ -371,6 +371,12 @@ class OpenSSL::TestX509Name < OpenSSL::TestCase
assert_equal "DC = org, DC = ruby-lang, " \
"CN = \"\\E3\\83\\95\\E3\\83\\BC, \\E3\\83\\90\\E3\\83\\BC\"",
name.to_s(OpenSSL::X509::Name::ONELINE)
+
+ empty = OpenSSL::X509::Name.new
+ assert_equal "", empty.to_s
+ assert_equal "", empty.to_s(OpenSSL::X509::Name::COMPAT)
+ assert_equal "", empty.to_s(OpenSSL::X509::Name::RFC2253)
+ assert_equal "", empty.to_s(OpenSSL::X509::Name::ONELINE)
end
def test_to_utf8
@@ -386,6 +392,9 @@ class OpenSSL::TestX509Name < OpenSSL::TestCase
expected = "CN=フー\\, バー,DC=ruby-lang,DC=org".force_encoding("UTF-8")
assert_equal expected, str
assert_equal Encoding.find("UTF-8"), str.encoding
+
+ empty = OpenSSL::X509::Name.new
+ assert_equal "", empty.to_utf8
end
def test_equals2