mirror of
https://github.com/ruby/ruby.git
synced 2025-08-26 22:45:03 +02:00
* test/ruby/test_eval.rb (class TestEval): Add test for shared eval
filenames via rb_fstring(). * test/ruby/test_iseq.rb (class TestISeq): Add test for shared iseq labels via rb_fstring(). [Bug #9159] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0c3b3e9237
commit
fdcc476e21
3 changed files with 29 additions and 0 deletions
|
@ -473,4 +473,16 @@ class TestEval < Test::Unit::TestCase
|
|||
fname = "\u{3042}".encode("euc-jp")
|
||||
assert_equal(fname, eval("__FILE__", nil, fname, 1))
|
||||
end
|
||||
|
||||
def test_eval_location_fstring
|
||||
o = Object.new
|
||||
o.instance_eval "def foo() end", "generated code"
|
||||
o.instance_eval "def bar() end", "generated code"
|
||||
|
||||
a, b = o.method(:foo).source_location[0],
|
||||
o.method(:bar).source_location[0]
|
||||
|
||||
assert_equal a.object_id, b.object_id,
|
||||
"#{a.inspect}.object_id != #{b.inspect}.object_id"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue