###############################################################################
#
# scope-error.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 scope-3.1 {error with open scope inside proc} -setup {
  proc foo { name a } {
    set c 9
    scope create -open -clone $name
    error "this is a test error."
    # scope close; # always implied
  }
} -body {
  set s foo
  if {![info exists i]} then {set i 0}
  list $i [catch {foo $s i} error] $error $i
} -cleanup {
  catch {scope destroy $s}
  unset -nocomplain s i error
  rename foo ""
} -constraints {eagle} -result {0 1 {this is a test error.} 0}}

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

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