1
0
Fork 0

added more tests

This commit is contained in:
Jan Steemann 2013-01-14 00:02:10 +01:00
parent 6acc85389c
commit 4761e9c28c
2 changed files with 40 additions and 2 deletions

View File

@ -531,7 +531,7 @@ function CollectionAnyExpander (config, vertex, path) {
/// @brief default expander that expands all edges labeled with one label in config.labels
///////////////////////////////////////////////////////////////////////////////////////////
var ExpandEdgesWithLabels = function (config, vertex, path) {
function ExpandEdgesWithLabels (config, vertex, path) {
var result = [ ];
if (!Array.isArray(config.labels)) {
config.labels = [config.labels];

View File

@ -334,7 +334,7 @@ function ahuacatlQueryTraverseTestSuite () {
/// @brief test max-depth filtering
////////////////////////////////////////////////////////////////////////////////
testTraversalDepthFirstMax : function () {
testTraversalDepthFirstMax1 : function () {
var config = {
strategy: "depthfirst",
order: "preorder",
@ -348,6 +348,24 @@ function ahuacatlQueryTraverseTestSuite () {
assertEqual([ "A", "B", "C", "D", "C" ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test max-depth filtering
////////////////////////////////////////////////////////////////////////////////
testTraversalDepthFirstMax2 : function () {
var config = {
strategy: "depthfirst",
order: "preorder",
itemOrder: "forward",
maxDepth: 3,
_sort: true
};
var actual = executeQuery("FOR p IN TRAVERSE(@@v, @@e, '" + vn + "/A', 'outbound', " + JSON.stringify(config) + ") RETURN p.vertex._key", { "@v" : vn, "@e" : en }).getRows();
assertEqual([ "A", "B", "C", "A", "D", "C", "A" ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test max-depth filtering
////////////////////////////////////////////////////////////////////////////////
@ -368,6 +386,26 @@ function ahuacatlQueryTraverseTestSuite () {
assertEqual([ "A", "B", "C", "D" ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test max-depth filtering
////////////////////////////////////////////////////////////////////////////////
testTraversalDepthFirstUniquePath : function () {
var config = {
strategy: "depthfirst",
order: "preorder",
itemOrder: "forward",
uniqueness: {
vertices: "path"
},
_sort: true
};
var actual = executeQuery("FOR p IN TRAVERSE(@@v, @@e, '" + vn + "/A', 'outbound', " + JSON.stringify(config) + ") RETURN p.vertex._key", { "@v" : vn, "@e" : en }).getRows();
assertEqual([ "A", "B", "C", "D", "C" ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test max-depth filtering
////////////////////////////////////////////////////////////////////////////////