Skip to content

Commit

Permalink
Add test for Errno constants
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jan 13, 2024
1 parent 55335ea commit 4e5754a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/ruby/test_exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,14 @@ def test_errno
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(", ")
Expand Down

0 comments on commit 4e5754a

Please sign in to comment.