Sha256: b8e6ce34ca25f9998ee0c8c28ba8e8480b66645ea31c352d822cfd6c3df8be32

Contents?: true

Size: 439 Bytes

Versions: 15

Compression:

Stored size: 439 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'lib', 'ludy/test/helper')
require 'ludy/deprecated/rambda'

class TestRambda < Test::Unit::TestCase
  include Ludy
  def test_rambda
    assert_equal(3628800, rambda{|n| n==1 ? 1 : n*this[n-1]}[10])
    assert_equal([1,1,2,3,5,8,13,21,34,55],
      (0...10).map(&rambda{|n| n<=1 ? 1 : this[n-2]+this[n-1]}))

    v = "can't refer v"
    assert_raise(NameError){ rambda{v}.call }
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 test/deprecated/rambda.rb
ludy-0.1.15 test/deprecated/rambda.rb
ludy-0.1.1 test/deprecated/rambda.rb
ludy-0.1.10 test/deprecated/rambda.rb
ludy-0.1.11 test/deprecated/rambda.rb
ludy-0.1.13 test/deprecated/rambda.rb
ludy-0.1.2 test/deprecated/rambda.rb
ludy-0.1.0 test/deprecated/rambda.rb
ludy-0.1.3 test/deprecated/rambda.rb
ludy-0.1.4 test/deprecated/rambda.rb
ludy-0.1.5 test/deprecated/rambda.rb
ludy-0.1.6 test/deprecated/rambda.rb
ludy-0.1.7 test/deprecated/rambda.rb
ludy-0.1.8 test/deprecated/rambda.rb
ludy-0.1.9 test/deprecated/rambda.rb