Sha256: fb42483439eebb14b42724e6771decbdd755de63f89bf2d3762847b8d7832848

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/more/lisp.rb
#
# Extracted Fri Feb 16 02:00:36 EST 2007
# Project.rb Test Extraction
#

require 'facets/more/lisp.rb'


  require 'test/unit'

  # fixture

  class T

    include Lisp

    (def accumulate (fun, x, list)
      (if (null? list)
        x
      else
        (accumulate fun, (fun.call x, (car list)), (cdr list))
      end)
    end)

  end

  # test

  class TC_Lisp < Test::Unit::TestCase

    include Lisp

    def test_accumulate
      t = T.new
      t.accumulate( proc{ |x,y| x+y }, 0, [1,2,3] )
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.8.49 test/lib/facets/more/test_lisp.rb