###############################################################################
#
# try3.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 try-4.1 {try/throw/finally} -setup {
  unset -nocomplain x z
} -body {
  list [catch {
    try {
      lappend z try_before
      catch {unset x}
      throw "failure" 999
      lappend z try_after
    } finally {
      lappend z finally_before
      catch {unset x}
      lappend z finally_after
    }
  } error] [string match "caught exception while executing command:\
Eagle._Components.Public.ScriptException: failure\n*" \
[string map [list \r\n \n] $error]] $z
} -cleanup {
  unset -nocomplain z error
} -constraints {eagle} -result \
{1 True {try_before finally_before finally_after}}}

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

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