Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'test/graph.xspec')
-rw-r--r--test/graph.xspec46
1 files changed, 46 insertions, 0 deletions
diff --git a/test/graph.xspec b/test/graph.xspec
index 14a04ef..c5e3216 100644
--- a/test/graph.xspec
+++ b/test/graph.xspec
@@ -171,4 +171,50 @@
$edge/@cattr = 'cvalue'
and $edge/@cattr2 = 'cvalue2'" />
</scenario>
+
+
+ <scenario label="graph:union">
+ <scenario label="given nothing">
+ <call function="graph:union">
+ <param name="graphs"
+ select="()" />
+ </call>
+
+ <expect label="produces an empty graph"
+ select="$foo:graph-empty" />
+ </scenario>
+
+
+ <scenario label="given two empty graphs">
+ <call function="graph:union">
+ <param name="graphs"
+ select="( $foo:graph-empty, $foo:graph-empty )" />
+ </call>
+
+ <expect label="produces an empty graph"
+ select="$foo:graph-empty" />
+ </scenario>
+
+
+ <scenario label="given graph with empty">
+ <call function="graph:union">
+ <param name="graphs"
+ select="( $foo:graph-empty, $foo:graph-vtwo )" />
+ </call>
+
+ <expect label="produces the non-empty graph"
+ select="$foo:graph-vtwo" />
+ </scenario>
+
+
+ <scenario label="given two different graphs">
+ <call function="graph:union">
+ <param name="graphs"
+ select="( $foo:graph-vtwo, $foo:graph-vthree )" />
+ </call>
+
+ <expect label="merges vertices and edges of unique vertices"
+ select="$foo:graph-vtwo-vthree" />
+ </scenario>
+ </scenario>
</description>