Skip to content

Commit

Permalink
Make NoMatchingPatternError a subclass of StandardError
Browse files Browse the repository at this point in the history
  • Loading branch information
k-tsj committed Dec 22, 2020
1 parent 53510d1 commit 31b17a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion error.c
Original file line number Diff line number Diff line change
Expand Up @@ -2804,7 +2804,7 @@ Init_Exception(void)
rb_eNoMemError = rb_define_class("NoMemoryError", rb_eException);
rb_eEncodingError = rb_define_class("EncodingError", rb_eStandardError);
rb_eEncCompatError = rb_define_class_under(rb_cEncoding, "CompatibilityError", rb_eEncodingError);
rb_eNoMatchingPatternError = rb_define_class("NoMatchingPatternError", rb_eRuntimeError);
rb_eNoMatchingPatternError = rb_define_class("NoMatchingPatternError", rb_eStandardError);

syserr_tbl = st_init_numtable();
rb_eSystemCallError = rb_define_class("SystemCallError", rb_eStandardError);
Expand Down
4 changes: 4 additions & 0 deletions test/ruby/test_pattern_matching.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ def test_paren
end
end
def test_nomatchingpatternerror
assert_equal(StandardError, NoMatchingPatternError.superclass)
end
def test_invalid_syntax
assert_syntax_error(%q{
case 0
Expand Down

0 comments on commit 31b17a1

Please sign in to comment.