diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-04 07:50:15 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-04 07:50:15 +0000 |
commit | ec20d103e169ca9a1e613f6e7c2a200e593bf157 (patch) | |
tree | 3e597133eb72db00bccacd7ff4f9d4d4856be59b /test | |
parent | cfe19e4a9c8be5de4fed8f6f3491fedaa1d5ef42 (diff) | |
download | ruby-ec20d103e169ca9a1e613f6e7c2a200e593bf157.tar.gz ruby-ec20d103e169ca9a1e613f6e7c2a200e593bf157.tar.xz ruby-ec20d103e169ca9a1e613f6e7c2a200e593bf157.zip |
* parse.y (k_def): adjust the location of method definition to the
line of def. [Bug #2427]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_proc.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 6c2bae4c4..de95ed567 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -746,14 +746,15 @@ class TestProc < Test::Unit::TestCase assert(x.to_s.tainted?) end - def source_location_test - __LINE__ + @@line_of_source_location_test = __LINE__ + 1 + def source_location_test a=1, + b=2 end def test_source_location file, lineno = method(:source_location_test).source_location assert_match(/^#{ Regexp.quote(__FILE__) }$/, file) - assert_equal(source_location_test - 1, lineno) + assert_equal(@@line_of_source_location_test, lineno, 'Bug #2427') end def test_splat_without_respond_to |