1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test/ruby/test_flip.rb
nobu 69b716111f vm_core.h: flip_cnt in rb_iseq_t
* vm_core.h (rb_iseq_t): move flip_cnt from struct iseq_compile_data,
  because it has same life span as enclosing iseq.  [Bug #7671]
  [ruby-core:51296]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-08 05:41:44 +00:00

21 lines
524 B
Ruby

require 'test/unit'
require_relative 'envutil'
class TestFlip < Test::Unit::TestCase
def test_hidden_key
bug6899 = '[ruby-core:47253]'
foo = "foor"
bar = "bar"
assert_nothing_raised(NotImplementedError, bug6899) do
2000.times {eval %[(foo..bar) ? 1 : 2]}
end
end
def test_shared_eval
bug7671 = '[ruby-core:51296]'
vs = (1..9).to_a
vs.select {|n| if n==2..n==16 then 1 end}
v = eval("vs.select {|n| if n==3..n==6 then 1 end}")
assert_equal([*3..6], v, bug7671)
end
end