summaryrefslogtreecommitdiffstats
path: root/tcllib/modules/struct/graph/tests/arc/target.test
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 19:39:39 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2016-10-27 19:39:39 (GMT)
commitea28451286d3ea4a772fa174483f9a7a66bb1ab3 (patch)
tree6ee9d8a7848333a7ceeee3b13d492e40225f8b86 /tcllib/modules/struct/graph/tests/arc/target.test
parentb5ca09bae0d6a1edce939eea03594dd56383f2c8 (diff)
parent7c621da28f07e449ad90c387344f07a453927569 (diff)
downloadblt-ea28451286d3ea4a772fa174483f9a7a66bb1ab3.zip
blt-ea28451286d3ea4a772fa174483f9a7a66bb1ab3.tar.gz
blt-ea28451286d3ea4a772fa174483f9a7a66bb1ab3.tar.bz2
Merge commit '7c621da28f07e449ad90c387344f07a453927569' as 'tcllib'
Diffstat (limited to 'tcllib/modules/struct/graph/tests/arc/target.test')
-rw-r--r--tcllib/modules/struct/graph/tests/arc/target.test48
1 files changed, 48 insertions, 0 deletions
diff --git a/tcllib/modules/struct/graph/tests/arc/target.test b/tcllib/modules/struct/graph/tests/arc/target.test
new file mode 100644
index 0000000..5f74009
--- /dev/null
+++ b/tcllib/modules/struct/graph/tests/arc/target.test
@@ -0,0 +1,48 @@
+# -*- tcl -*-
+# Graph tests - arc target
+# Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net>
+# All rights reserved.
+# RCS: @(#) $Id: target.test,v 1.2 2007/04/12 03:01:55 andreas_kupries Exp $
+
+# Syntax: graph arc target ARC
+
+# -------------------------------------------------------------------------
+# Wrong # args: Missing, Too many
+
+test graph-${impl}-${setimpl}-arc-target-1.0 {arc target, wrong#arcs, missing} {
+ SETUP
+ catch {mygraph arc target} msg
+ mygraph destroy
+ set msg
+} [tmWrong {arc target} arc 0]
+
+test graph-${impl}-${setimpl}-arc-target-1.1 {arc target, wrong#arcs, too many} {
+ SETUP
+ catch {mygraph arc target a b} msg
+ mygraph destroy
+ set msg
+} [tmTooMany {arc target} arc]
+
+# -------------------------------------------------------------------------
+# Logical arguments checks and failures
+
+test graph-${impl}-${setimpl}-arc-target-2.0 {arc target, missing arc} {
+ SETUP
+ catch {mygraph arc target arc0} msg
+ mygraph destroy
+ set msg
+} [MissingArc $MY arc0]
+
+# -------------------------------------------------------------------------
+# Ok arguments.
+
+test graph-${impl}-${setimpl}-arc-target-3.0 {arc target} {
+ SETUP
+ mygraph node insert node0 node1
+ mygraph arc insert node0 node1 arc0
+ set result [mygraph arc target arc0]
+ mygraph destroy
+ set result
+} node1
+
+# ---------------------------------------------------