Sha256: de7da5ef96c304cc522089c1b33e482137545e5e16781d41daed1016348a2009

Contents?: true

Size: 454 Bytes

Versions: 16

Compression:

Stored size: 454 Bytes

Contents

require 'facets/thread.rb'
require 'test/unit'

class TC_Thread < Test::Unit::TestCase

  def test_threaded_map
    r = [1,2,3].threaded_map{ |e| e + 1 }
    assert_equal([2,3,4], r)
  end

  def test_threaded_map_send
    r = [1,2,3].threaded_map_send(:+, 1)
    assert_equal([2,3,4], r)
  end

  def test_map_send_with_block
    r = [[1,2,3],[2,3,4],[3,4,5]].threaded_map_send(:select){ |x| x > 2 }
    assert_equal([[3],[3,4],[3,4,5]], r)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-2.8.4 test/more/test_thread.rb
facets-2.8.3 test/more/test_thread.rb
facets-2.8.2 test/more/test_thread.rb
facets-2.8.1 test/more/test_thread.rb
facets-2.8.0 test/more/test_thread.rb
facets-2.7.0 test/more/test_thread.rb
facets-2.6.0 test/more/test_thread.rb
facets-2.4.0 test/test_thread.rb
facets-2.4.1 test/test_thread.rb
facets-2.4.2 test/more/test_thread.rb
facets-2.4.4 test/more/test_thread.rb
facets-2.4.3 test/more/test_thread.rb
facets-2.5.1 test/more/test_thread.rb
facets-2.5.0 test/more/test_thread.rb
facets-2.4.5 test/more/test_thread.rb
facets-2.5.2 test/more/test_thread.rb