From d8d5e67184e0647f56576a500993c064e60fc26a Mon Sep 17 00:00:00 2001 From: mame Date: Fri, 22 Jan 2010 14:53:12 +0000 Subject: * test/ruby/test_regexp.rb, test/ruby/test_symbol.rb, test/ruby/test_variable.rb: add some tests (for coverage of compile.c). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_regexp.rb | 5 +++++ test/ruby/test_symbol.rb | 4 ++++ test/ruby/test_variable.rb | 4 ++++ 3 files changed, 13 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb index cda8e9ebe9..4cd35d5248 100644 --- a/test/ruby/test_regexp.rb +++ b/test/ruby/test_regexp.rb @@ -795,4 +795,9 @@ class TestRegexp < Test::Unit::TestCase h = {a => 42} assert_equal(42, h[b], '[ruby-core:24748]') end + + def test_regexp_poped + assert_nothing_raised { eval("a = 1; /\#{ a }/; a") } + assert_nothing_raised { eval("a = 1; /\#{ a }/o; a") } + end end diff --git a/test/ruby/test_symbol.rb b/test/ruby/test_symbol.rb index f402da3907..0f09669293 100644 --- a/test/ruby/test_symbol.rb +++ b/test/ruby/test_symbol.rb @@ -132,4 +132,8 @@ class TestSymbol < Test::Unit::TestCase assert_equal(:Foo, :foo.capitalize) assert_equal(:fOo, :FoO.swapcase) end + + def test_symbol_poped + assert_nothing_raised { eval('a = 1; :"#{ a }"; 1') } + end end diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb index 990658cb5a..53e00301dc 100644 --- a/test/ruby/test_variable.rb +++ b/test/ruby/test_variable.rb @@ -85,4 +85,8 @@ class TestVariable < Test::Unit::TestCase def test_global_variable_poped assert_nothing_raised { eval("$foo; 1") } end + + def test_constant_poped + assert_nothing_raised { eval("TestVariable::Gods; 1") } + end end -- cgit v1.2.3