summaryrefslogtreecommitdiff
path: root/test/ruby/test_m17n.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_m17n.rb')
-rw-r--r--test/ruby/test_m17n.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_m17n.rb b/test/ruby/test_m17n.rb
index 21189e323fe..069554a1270 100644
--- a/test/ruby/test_m17n.rb
+++ b/test/ruby/test_m17n.rb
@@ -1113,6 +1113,13 @@ class TestM17N < Test::Unit::TestCase
assert_equal(Encoding::US_ASCII, {1=>nil,"foo"=>""}.to_s.encoding)
end
+ def test_encoding_find
+ assert_raise(TypeError) {Encoding.find(nil)}
+ assert_raise(TypeError) {Encoding.find(0)}
+ assert_raise(TypeError) {Encoding.find([])}
+ assert_raise(TypeError) {Encoding.find({})}
+ end
+
def test_encoding_to_s
assert_equal(Encoding::US_ASCII, Encoding::US_ASCII.to_s.encoding)
assert_equal(Encoding::US_ASCII, Encoding::US_ASCII.inspect.encoding)