###############################################################################
#
# fib.eagle --
#
# Extensible Adaptable Generalized Logic Engine (Eagle)
#
# Copyright (c) 2007-2012 by Joe Mistachkin.  All rights reserved.
#
# See the file "license.terms" for information on usage and redistribution of
# this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: $
#
###############################################################################

source [file join [file normalize [file dirname [info script]]] prologue.eagle]

###############################################################################

runTest {test fib-1.1 {recursive fibonacci sequence} -setup {
  proc fib {x} {
    if {$x <= 2} then {
      return 1
    } else {
      return [expr {[fib [expr {$x - 1}]] + [fib [expr {$x - 2}]]}]
    }
  }
} -body {
  fib 10
} -cleanup {
  rename fib ""
} -result {55}}

###############################################################################

source [file join [file normalize [file dirname [info script]]] epilogue.eagle]
