###############################################################################
#
# object8.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 object-8.1 {static/private object methods} -body {
  set interp [object invoke Interpreter GetActive]

  list [expr {[object invoke -flags {+NonPublic +Static} \
      Eagle._Components.Private.NativeStack GetNativeStackPointer] != 0}] \
      $interp [object invoke -flags {+NonPublic} $interp Cancel] \
      [object dispose $interp] [unset interp] [llength [info objects]]
} -cleanup {
  unset -nocomplain x
} -constraints {eagle native windows refCount compile.NATIVE compile.WINDOWS} \
-match regexp -result {^True Interpreter#\d+ False removed \{\} 1$}}

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

runTest {test object-8.2 {static/private object methods} -body {
  set interp [object invoke Interpreter GetActive]

  list $interp [catch {object invoke -flags {+NonPublic} $interp Cancel true} \
      msg] $msg [object dispose $interp] [unset interp] [llength [info objects]]
} -cleanup {
  unset -nocomplain x msg
} -constraints {eagle refCount} -match regexp -result {^Interpreter#\d+ 1\
\{eval canceled\} removed \{\} 1$}}

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

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