Skip to content

Commit

Permalink
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/jruby.index
Original file line number Diff line number Diff line change
@@ -68,6 +68,7 @@ jruby/test_string_java_bytes
jruby/test_string_printf
jruby/test_string_to_number
jruby/test_super_call_site_caching
jruby/test_symbol
jruby/test_system
jruby/test_system_error
jruby/test_timeout
37 changes: 37 additions & 0 deletions test/jruby/test_symbol.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
require 'test/unit'

class TestSymbol < Test::Unit::TestCase

def setup
@gc_stress = GC.stress
end

def teardown
GC.stress = @gc_stress
end

# moved from mri/ruby/test_symbol.rb

def test_to_proc_yield
#assert_ruby_status([], <<-"end;", timeout: 5.0)
GC.stress = true
assert_same true, true.tap(&:itself)
#end;
end

def test_to_proc_new_proc
#assert_ruby_status([], <<-"end;", timeout: 5.0)
GC.stress = true
assert_equal 2, 2.times { Proc.new(&:itself) }
#end;
end

def test_to_proc_no_method
#assert_separately([], <<-"end;", timeout: 5.0)
bug11566 = '[ruby-core:70980] [Bug #11566]'
assert_raise(NoMethodError, bug11566) { Proc.new(&:foo).(1) }
assert_raise(NoMethodError, bug11566) { :foo.to_proc.(1) }
#end;
end

end
3 changes: 3 additions & 0 deletions test/mri/excludes/TestSymbol.rb
Original file line number Diff line number Diff line change
@@ -3,5 +3,8 @@
exclude :test_to_proc_arg, "we have plans to do different caching here, see 69662ab8cd1616a2ee076488226a473648fc6267"
exclude :test_to_proc_binding, "needs investigation #4303"
exclude :test_to_proc_iseq, "needs investigation #4303"
exclude :test_to_proc_new_proc, "works but 'Timeout::Error: execution of assert_ruby_status expired\npid 28347 exit 143' on CI, moved to jruby/test_symbol.rb"
exclude :test_to_proc_no_method, "works but 'assert_separately failed\npid 28416 exit 143' on CI, moved to jruby/test_symbol.rb"
exclude :test_to_proc_yield, "works but 'Timeout::Error: execution of assert_ruby_status expired\npid 28480 exit 143' on CI, moved to jruby/test_symbol.rb"
exclude :test_symbol_encoding, "needs investigation"
#exclude :test_symbol_fstr_leak, "works but Test::Unit's assert_no_memory_leak spawns a sub-Ruby"

0 comments on commit 083290a

Please sign in to comment.