Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitm@lovullo.com>2016-07-05 15:36:41 -0400
committerMike Gerwitz <gerwitm@lovullo.com>2016-07-06 00:16:11 -0400
commitbcf1e0457fc3f8a41d9c8e7692228b33649d777a (patch)
tree53b91859f7c8d12b7b438b78a683efbad929b0e5 /test
parent551e489c5fdbee5057b27d665ed0a3ab1751b901 (diff)
downloadtame-bcf1e0457fc3f8a41d9c8e7692228b33649d777a.tar.gz
tame-bcf1e0457fc3f8a41d9c8e7692228b33649d777a.tar.bz2
tame-bcf1e0457fc3f8a41d9c8e7692228b33649d777a.zip
Move graph:dep-lookup into Package Subgraphs subsection
* src/graph.xsl (graph:dep-lookup): Moved into subsection with introductory paragraph.
Diffstat (limited to 'test')
-rw-r--r--test/graph.xspec173
1 files changed, 93 insertions, 80 deletions
diff --git a/test/graph.xspec b/test/graph.xspec
index c5e3216..7c823f0 100644
--- a/test/graph.xspec
+++ b/test/graph.xspec
@@ -28,86 +28,6 @@
xmlns:foo="http://www.lovullo.com/_junk"
stylesheet="graph-test.xsl">
- <scenario label="graph:dep-lookup">
- <scenario label="given a symbol">
- <scenario label="in the same package">
- <scenario label="where dependencies exist">
- <call function="graph:dep-lookup">
- <param name="symbol"
- select="$foo:document/preproc:symtable
- /preproc:sym[ @name='local' ]" />
- <param name="graph"
- select="$foo:document/preproc:sym-deps" />
-
- <param name="lookup" select="()" />
- </call>
-
- <expect label="returns local dependencies"
- test="$x:result is
- $foo:document/preproc:sym-deps/preproc:sym-dep[
- @name='local' ]" />
- </scenario>
-
-
- <scenario label="with external @src but local deps">
- <call function="graph:dep-lookup">
- <param name="symbol"
- select="$foo:document/preproc:symtable
- /preproc:sym[ @name='external-but-not' ]" />
- <param name="graph"
- select="$foo:document/preproc:sym-deps" />
-
- <param name="lookup" select="()" />
- </call>
-
- <expect label="returns local dependencies"
- test="$x:result is
- $foo:document/preproc:sym-deps/preproc:sym-dep[
- @name='external-but-not' ]" />
- </scenario>
-
-
- <scenario label="where dependencies are missing">
- <call function="graph:dep-lookup">
- <param name="symbol"
- select="$foo:document/preproc:symtable
- /preproc:sym[ @name='missing-deps' ]" />
- <param name="graph"
- select="$foo:document/preproc:sym-deps" />
-
- <param name="lookup" select="()" />
- </call>
-
- <expect label="return empty sequence"
- test="empty( $x:result )" />
- </scenario>
- </scenario>
-
-
- <scenario label="in a separate package">
- <variable name="foo:expected-lookup" as="element()">
- <foo:lookup-ok />
- </variable>
-
- <scenario label="where dependencies exist">
- <call function="graph:dep-lookup">
- <param name="symbol"
- select="$foo:document/preproc:symtable
- /preproc:sym[ @name='external' ]" />
- <param name="graph"
- select="$foo:document/preproc:sym-deps" />
-
- <param name="lookup"
- select="foo:lookup( $foo:expected-lookup )" />
- </call>
-
- <expect label="returns external dependenices"
- test="exists( $x:result/foo:lookup-ok )" />
- </scenario>
- </scenario>
- </scenario>
- </scenario>
-
<scenario label="graph:reverse on a disconnected DAG">
<call function="graph:reverse">
@@ -216,5 +136,98 @@
<expect label="merges vertices and edges of unique vertices"
select="$foo:graph-vtwo-vthree" />
</scenario>
+
+
+ <scenario label="given single graph with duplicate vectors">
+ <call function="graph:union">
+ <param name="graphs"
+ select="$foo:graph-with-dupes" />
+ </call>
+
+ <expect label="mergs duplicates"
+ select="$foo:graph-deduped" />
+ </scenario>
+ </scenario>
+
+
+
+ <scenario label="graph:dep-lookup">
+ <scenario label="given a symbol">
+ <scenario label="in the same package">
+ <scenario label="where dependencies exist">
+ <call function="graph:dep-lookup">
+ <param name="symbol"
+ select="$foo:document/preproc:symtable
+ /preproc:sym[ @name='local' ]" />
+ <param name="graph"
+ select="$foo:document/preproc:sym-deps" />
+
+ <param name="lookup" select="()" />
+ </call>
+
+ <expect label="returns local dependencies"
+ test="$x:result is
+ $foo:document/preproc:sym-deps/preproc:sym-dep[
+ @name='local' ]" />
+ </scenario>
+
+
+ <scenario label="with external @src but local deps">
+ <call function="graph:dep-lookup">
+ <param name="symbol"
+ select="$foo:document/preproc:symtable
+ /preproc:sym[ @name='external-but-not' ]" />
+ <param name="graph"
+ select="$foo:document/preproc:sym-deps" />
+
+ <param name="lookup" select="()" />
+ </call>
+
+ <expect label="returns local dependencies"
+ test="$x:result is
+ $foo:document/preproc:sym-deps/preproc:sym-dep[
+ @name='external-but-not' ]" />
+ </scenario>
+
+
+ <scenario label="where dependencies are missing">
+ <call function="graph:dep-lookup">
+ <param name="symbol"
+ select="$foo:document/preproc:symtable
+ /preproc:sym[ @name='missing-deps' ]" />
+ <param name="graph"
+ select="$foo:document/preproc:sym-deps" />
+
+ <param name="lookup" select="()" />
+ </call>
+
+ <expect label="return empty sequence"
+ test="empty( $x:result )" />
+ </scenario>
+ </scenario>
+
+
+ <scenario label="in a separate package">
+ <variable name="foo:expected-lookup" as="element()">
+ <foo:lookup-ok />
+ </variable>
+
+ <scenario label="where dependencies exist">
+ <call function="graph:dep-lookup">
+ <param name="symbol"
+ select="$foo:document/preproc:symtable
+ /preproc:sym[ @name='external' ]" />
+ <param name="graph"
+ select="$foo:document/preproc:sym-deps" />
+
+ <param name="lookup"
+ select="foo:lookup( $foo:expected-lookup )" />
+ </call>
+
+ <expect label="returns external dependenices"
+ test="exists( $x:result/foo:lookup-ok )" />
+ </scenario>
+ </scenario>
+ </scenario>
</scenario>
</description>