diff options
author | Mike Gerwitz <gerwitm@lovullo.com> | 2016-07-05 16:14:57 -0400 |
---|---|---|
committer | Mike Gerwitz <gerwitm@lovullo.com> | 2016-07-06 00:16:12 -0400 |
commit | e5da6f8ce10f9b7cd5e11ffe7a3ba4302ba6c216 (patch) | |
tree | 0b6424d2d57b408495af2c92bc18bc0db2a3d4a0 /test | |
parent | 641147cd8ff84755b640869e55c8be48cc566b31 (diff) | |
download | tame-e5da6f8ce10f9b7cd5e11ffe7a3ba4302ba6c216.tar.gz tame-e5da6f8ce10f9b7cd5e11ffe7a3ba4302ba6c216.tar.bz2 tame-e5da6f8ce10f9b7cd5e11ffe7a3ba4302ba6c216.zip |
Add graph:make-from-vertices
* src/graph.xsl (graph:make-from-vertices): Added
* test/graph-test.xsl (foo:graph-with-dupes): Added duplicate edges
* test/graph.xspec: Added tests
Diffstat (limited to 'test')
-rw-r--r-- | test/graph-test.xsl | 2 | ||||
-rw-r--r-- | test/graph.xspec | 36 |
2 files changed, 37 insertions, 1 deletions
diff --git a/test/graph-test.xsl b/test/graph-test.xsl index e8f7b5b..eaa654d 100644 --- a/test/graph-test.xsl +++ b/test/graph-test.xsl @@ -146,9 +146,9 @@ <variable name="foo:graph-vtwo-vthree" as="element( preproc:sym-deps )"> <preproc:sym-deps> <preproc:sym-dep name="a"> - <preproc:sym-ref name="a" attr1="foo" /> <preproc:sym-ref name="b" attr1="foo" attr2="bar" /> <preproc:sym-ref name="c" /> + <preproc:sym-ref name="a" attr1="foo" /> </preproc:sym-dep> <preproc:sym-dep name="b"> diff --git a/test/graph.xspec b/test/graph.xspec index 7c823f0..209f965 100644 --- a/test/graph.xspec +++ b/test/graph.xspec @@ -29,6 +29,42 @@ stylesheet="graph-test.xsl"> + <scenario label="graph:make-from-vertices"> + <scenario label="with no vertices"> + <call function="graph:make-from-vertices"> + <param name="vertices" + select="()" /> + </call> + + <expect label="produces an empty graph"> + <preproc:sym-deps /> + </expect> + </scenario> + + + <scenario label="with vertices"> + <call function="graph:make-from-vertices"> + <param name="vertices" + select="$foo:graph-vtwo/preproc:sym-dep" /> + </call> + + <expect label="produces a graph containing those vertices" + select="$foo:graph-vtwo" /> + </scenario> + + + <scenario label="with duplicate vertices"> + <call function="graph:make-from-vertices"> + <param name="vertices" + select="$foo:graph-with-dupes/preproc:sym-dep" /> + </call> + + <expect label="removes duplicate vertices and edges" + select="$foo:graph-deduped" /> + </scenario> + </scenario> + + <scenario label="graph:reverse on a disconnected DAG"> <call function="graph:reverse"> <param name="graph" |