ruby-changes:64470
From: Kazuki <ko1@a...>
Date: Wed, 23 Dec 2020 02:37:58 +0900 (JST)
Subject: [ruby-changes:64470] 31b17a14ab (master): Make NoMatchingPatternError a subclass of StandardError
https://git.ruby-lang.org/ruby.git/commit/?id=31b17a14ab From 31b17a14abf9686a0a9b6777c6b47285f510b66a Mon Sep 17 00:00:00 2001 From: Kazuki Tsujimoto <kazuki@c...> Date: Wed, 23 Dec 2020 02:31:02 +0900 Subject: Make NoMatchingPatternError a subclass of StandardError diff --git a/error.c b/error.c index e74b214..5e3e4e3 100644 --- a/error.c +++ b/error.c @@ -2804,7 +2804,7 @@ Init_Exception(void) https://github.com/ruby/ruby/blob/trunk/error.c#L2804 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); diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index e553789..243a4cd 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1162,6 +1162,10 @@ END https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L1162 end end + def test_nomatchingpatternerror + assert_equal(StandardError, NoMatchingPatternError.superclass) + end + def test_invalid_syntax assert_syntax_error(%q{ case 0 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/