Sha256: 2799ccd23c19bc18fe920dcf42f4e1523921f14eaa170212e4f22fc5ee73ae6b

Contents?: true

Size: 369 Bytes

Versions: 3

Compression:

Stored size: 369 Bytes

Contents

require 'test/unit'
require 'facet/functor'


class TC_Functor < Test::Unit::TestCase

  def test_it
    f = Functor.new { |op, x| x.send(op, x) }
    assert_equal( 2, f + 1 ) #=> 2
    assert_equal( 4, f + 2 ) #=> 4
    assert_equal( 6, f + 3 ) #=> 6
    assert_equal( 1, f * 1 ) #=> 1
    assert_equal( 4, f * 2 ) #=> 4
    assert_equal( 9, f * 3 ) #=> 9
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facets-0.7.0 test/tc_functor.rb
facets-0.7.1 test/tc_functor.rb
facets-0.7.2 test/tc_functor.rb