Sha256: c055966960fcc15090774837b8d9d48fd64edbbabce48462da9e271ddd05885f
Contents?: true
Size: 369 Bytes
Versions: 1
Compression:
Stored size: 369 Bytes
Contents
require 'test/unit' require 'carat/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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
carats-0.3.0 | test/tc_functor.rb |