1
0
Fork 0
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:
Kazuki Tsujimoto 2020-12-23 02:31:02 +09:00
parent 53510d1e8a
commit 31b17a14ab
No known key found for this signature in database
GPG key ID: BCEA306C49B81CD7
2 changed files with 5 additions and 1 deletions

View file

@ -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);

View file

@ -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