# _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # # for lib/mega/lisp.rb # # Extracted Fri Oct 28 14:20:18 EDT 2005 # Unit Tools Reap Test Extractor # require 'mega/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