diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_parse.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index c2ee56ae52..09cb0cf2a5 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -965,6 +965,19 @@ x = __ENCODING__ end; end + def test_method_location_in_rescue + bug = '[ruby-core:79388] [Bug #13181]' + obj, line = Object.new, __LINE__+1 + def obj.location + # + raise + rescue + caller_locations(1, 1)[0] + end + + assert_equal(line, obj.location.lineno, bug) + end + =begin def test_past_scope_variable assert_warning(/past scope/) {catch {|tag| eval("BEGIN{throw tag}; tap {a = 1}; a")}} |