mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Make NoMatchingPatternError a subclass of StandardError
This commit is contained in:
parent
53510d1e8a
commit
31b17a14ab
2 changed files with 5 additions and 1 deletions
2
error.c
2
error.c
|
@ -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);
|
||||
|
|
|
@ -1162,6 +1162,10 @@ END
|
|||
end
|
||||
end
|
||||
|
||||
def test_nomatchingpatternerror
|
||||
assert_equal(StandardError, NoMatchingPatternError.superclass)
|
||||
end
|
||||
|
||||
def test_invalid_syntax
|
||||
assert_syntax_error(%q{
|
||||
case 0
|
||||
|
|
Loading…
Add table
Reference in a new issue