summaryrefslogtreecommitdiff
path: root/test/ruby/test_exception.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2024-01-14 00:24:14 +0900
committerNobuyoshi Nakada <[email protected]>2024-01-14 00:24:14 +0900
commit4e5754a459ea10c73381b3009bb889e83077575c (patch)
tree8421fb3930aa2ccaa64102da9114ef3d107e76fd /test/ruby/test_exception.rb
parent55335eab80d763fb11d621c041d23aaf8f4857c6 (diff)
Add test for `Errno` constants
Diffstat (limited to 'test/ruby/test_exception.rb')
-rw-r--r--test/ruby/test_exception.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_exception.rb b/test/ruby/test_exception.rb
index b3951c7e51..84c750bf32 100644
--- a/test/ruby/test_exception.rb
+++ b/test/ruby/test_exception.rb
@@ -540,6 +540,14 @@ end.join
assert_equal(Encoding.find("locale"), Errno::EINVAL.new.message.encoding)
end
+ def test_errno_constants
+ assert_equal [:NOERROR], Errno.constants.grep_v(/\AE/)
+ all_assertions_foreach("should be a subclass of SystemCallError", *Errno.constants) do |c|
+ e = Errno.const_get(c)
+ assert_operator e, :<, SystemCallError, proc {e.ancestors.inspect}
+ end
+ end
+
def test_too_many_args_in_eval
bug5720 = '[ruby-core:41520]'
arg_string = (0...140000).to_a.join(", ")