diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-13 15:01:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-13 15:01:20 +0000 |
commit | d62f56b04182f5b7b02944d5c169fe44513135b1 (patch) | |
tree | 73830445eb27610ab4a7a4bede497dea016f5153 /test/ruby/test_parse.rb | |
parent | 3dd1e6a91bdd1d743c6f47c910e94b707b7eb190 (diff) | |
download | ruby-d62f56b04182f5b7b02944d5c169fe44513135b1.tar.gz |
* parse.y (primary): point method name line. [ruby-core:40936]
[Bug #5614]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_parse.rb')
-rw-r--r-- | test/ruby/test_parse.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb index 14990be12c..f0f872013d 100644 --- a/test/ruby/test_parse.rb +++ b/test/ruby/test_parse.rb @@ -825,4 +825,18 @@ x = __ENCODING__ c.instance_eval { remove_class_variable(:@var) } end end + + def test_method_block_location + bug5614 = '[ruby-core:40936]' + expected = nil + e = assert_raise(NoMethodError) do + 1.times do + expected = __LINE__+1 + end.print do + # + end + end + actual = e.backtrace.first[/\A#{Regexp.quote(__FILE__)}:(\d+):/o, 1].to_i + assert_equal(expected, actual, bug5614) + end end |