summaryrefslogtreecommitdiff
path: root/test/ruby/test_flip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_flip.rb')
-rw-r--r--test/ruby/test_flip.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_flip.rb b/test/ruby/test_flip.rb
new file mode 100644
index 0000000..bd14228
--- /dev/null
+++ b/test/ruby/test_flip.rb
@@ -0,0 +1,21 @@
+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