head	1.1;
access;
symbols
	tcllib-1-13:1.1
	tcllib-1-12:1.1
	tklib-0-5:1.1
	tcllib-1-11-1:1.1
	tcllib-1-11:1.1
	tcllib-1-10:1.1;
locks; strict;
comment	@# @;


1.1
date	2006.11.16.06.33.14;	author andreas_kupries;	state Exp;
branches;
next	;


desc
@@


1.1
log
@
	* pkgIndex.tcl: Version of graph bumped to 2.2.

	* graph.man: Updated documentation for new features, extended
	  abilities, critcl implementation, etc.

	* graph.tcl:     Changed core graph code to support multiple
	* graph_tcl.tcl: implementations, and Tcl implementation. Added
	  some more features (arc|node delete multiple nodes, insertion of
	  multiple nodes, flipping the direction of arcs), internal
	  refactoring of common argument checks, additional checks closing
	  some holes.

	* graph_c.tcl: Critcl based implementation of graph.
	* graph/arc.c:
	* graph/methods.c:
	* graph/ds.h:
	* graph/node.c:
	* graph/objcmd.h:
	* graph/attr.c:
	* graph/arcshimmer.c:
	* graph/objcmd.c:
	* graph/arc.h:
	* graph/filter.c:
	* graph/methods.h:
	* graph/util.c:
	* graph/util.h:
	* graph/node.h:
	* graph/graph.h:
	* graph/graph.c:
	* graph/nacommon.c:
	* graph/walk.c:
	* graph/walk.h:
	* graph/global.h:
	* graph/nodeshimmer.c:
	* graph/attr.h:
	* graph/global.c:
	* graph/nacommon.h:

	* graph.test: Reworked testsuite, split into about one file per
	* graph/tests/Xsetup: tested method, plus helper and control
	* graph/tests/arc/delete.test: files. Extended testsuite testing
	* graph/tests/arc/exists.test: several of the holes which were
	* graph/tests/arc/flip.test: closed and had never been tested
	* graph/tests/arc/insert.test: before.
	* graph/tests/arc/move.test:
	* graph/tests/arc/move-source.test:
	* graph/tests/arc/move-target.test:
	* graph/tests/arc/rename.test:
	* graph/tests/arc/source.test:
	* graph/tests/arc/target.test:
	* graph/tests/arc/attr.test:
	* graph/tests/attr/get.test:
	* graph/tests/attr/getall.test:
	* graph/tests/attr/keyexists.test:
	* graph/tests/attr/keys.test:
	* graph/tests/attr/lappend.test:
	* graph/tests/attr/set.test:
	* graph/tests/attr/unset.test:
	* graph/tests/attr/append.test:
	* graph/tests/attr/Xsetup:
	* graph/tests/node/degree.test:
	* graph/tests/node/delete.test:
	* graph/tests/node/exists.test:
	* graph/tests/node/insert.test:
	* graph/tests/node/rename.test:
	* graph/tests/node/opposite.test:
	* graph/tests/node/attr.test:
	* graph/tests/walk.test:
	* graph/tests/Xsupport:
	* graph/tests/Xcontrol:
	* graph/tests/arcs.test:
	* graph/tests/nodes.test:
	* graph/tests/deserialize.test:
	* graph/tests/assign.test:
	* graph/tests/serialize.test:
	* graph/tests/command.test:
	* graph/tests/rassign.test:
	* graph/tests/swap.test:
@
text
@# -*- tcl -*-
# Graph tests - Attribute helper commands
# Copyright (c) 2006 Andreas Kupries <andreas_kupries@@users.sourceforge.net>
# All rights reserved.
# RCS: @@(#) $Id: graph.test,v 1.25 2006/10/09 21:41:42 andreas_kupries Exp $

# -------------------------------------------------------------------------

proc Arc   {} {mygraph node insert 0 1 ; mygraph arc insert 0 1 x}
proc Node  {} {mygraph node insert x}
proc Graph {} {}

proc SetRArc   {a} {CMD set x $a}
proc SetRNode  {a} {CMD set x $a}
proc SetRGraph {a} {CMD set   $a}

proc SetWArc   {a v} {CMD set x $a $v}
proc SetWNode  {a v} {CMD set x $a $v}
proc SetWGraph {a v} {CMD set   $a $v}

proc GetArc   {a} {CMD get x $a}
proc GetNode  {a} {CMD get x $a}
proc GetGraph {a} {CMD get   $a}

proc UnsetArc   {a} {CMD unset x $a}
proc UnsetNode  {a} {CMD unset x $a}
proc UnsetGraph {a} {CMD unset   $a}

proc AppendArc   {a v} {CMD append x $a $v}
proc AppendNode  {a v} {CMD append x $a $v}
proc AppendGraph {a v} {CMD append   $a $v}

proc LappendArc   {a v} {CMD lappend x $a $v}
proc LappendNode  {a v} {CMD lappend x $a $v}
proc LappendGraph {a v} {CMD lappend   $a $v}

proc KeyexistsArc   {a} {CMD keyexists x $a}
proc KeyexistsNode  {a} {CMD keyexists x $a}
proc KeyexistsGraph {a} {CMD keyexists   $a}

proc GetallArc   {} {CMD getall x}
proc GetallNode  {} {CMD getall x}
proc GetallGraph {} {CMD getall  }

proc GetallPArc   {p} {CMD getall x $p}
proc GetallPNode  {p} {CMD getall x $p}
proc GetallPGraph {p} {CMD getall   $p}

proc KeysArc   {} {CMD keys x}
proc KeysNode  {} {CMD keys x}
proc KeysGraph {} {CMD keys  }

proc KeysPArc   {p} {CMD keys x $p}
proc KeysPNode  {p} {CMD keys x $p}
proc KeysPGraph {p} {CMD keys   $p}

# -------------------------------------------------------------------------

proc AttrSetup {} {
    # CMD is for the testing of wrong#args errors.
    # XXX$ex are for regular tests, i.e. argument
    # errors and ok behaviour.

    upvar 1 mk mk stem stem e e MY MY

    if {$mk == {}} {set mk $MY}

    # CMD = stem, remove existing CMD
    catch {interp alias {} CMD {}}
    eval [linsert $stem 0 interp alias {} CMD {}]

    # To skip tests which do not apply to graph attributes
    ::tcltest::testConstraint graph \
	    [string equal $e graph]
    return
}

# -------------------------------------------------------------------------
@
