Sha256: 092424dc5f6a213d2d8a67ce8c2571858d67227c19a94565177c5044973a0b94
Contents?: true
Size: 438 Bytes
Versions: 16
Compression:
Stored size: 438 Bytes
Contents
require 'facets/proc/compose.rb' require 'test/unit' class TestProc < Test::Unit::TestCase def test_compose a = lambda { |x| x + 4 } b = lambda { |y| y / 2 } assert_equal( 6, (a.compose(b)).call(4) ) assert_equal( 4, (b.compose(a)).call(4) ) end def test_compose_op a = lambda { |x| x + 4 } b = lambda { |y| y / 2 } assert_equal( 6, (a * b).call(4) ) assert_equal( 4, (b * a).call(4) ) end end
Version data entries
16 entries across 16 versions & 1 rubygems