mirror of https://gitee.com/bigwinds/arangodb
Merged conflict
This commit is contained in:
commit
1fae3deaa8
|
@ -85,10 +85,6 @@ ArangoStatement.prototype.bind = function (key, value) {
|
|||
this._bindVars = key;
|
||||
}
|
||||
else if (typeof(key) === "string") {
|
||||
if (this._bindVars[key] !== undefined) {
|
||||
throw "redeclaration of bind parameter";
|
||||
}
|
||||
|
||||
this._bindVars[key] = value;
|
||||
}
|
||||
else if (typeof(key) === "number") {
|
||||
|
@ -98,10 +94,6 @@ ArangoStatement.prototype.bind = function (key, value) {
|
|||
throw "invalid bind parameter declaration";
|
||||
}
|
||||
|
||||
if (this._bindVars[strKey] !== undefined) {
|
||||
throw "redeclaration of bind parameter";
|
||||
}
|
||||
|
||||
this._bindVars[strKey] = value;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -69,9 +69,23 @@ function CollectionDocumentSuiteErrorHandling () {
|
|||
/// @brief bad handle
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testErrorHandlingBadHandle : function () {
|
||||
testErrorHandlingBadHandleDatabase : function () {
|
||||
try {
|
||||
collection.document(" 123456");
|
||||
internal.db._document("123456");
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
assertEqual(ERRORS.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code, err.errorNum);
|
||||
}
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bad handle
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testErrorHandlingBadHandleCollection : function () {
|
||||
try {
|
||||
collection.document("");
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
@ -85,7 +99,7 @@ function CollectionDocumentSuiteErrorHandling () {
|
|||
|
||||
testErrorHandlingBadHandleReplace : function () {
|
||||
try {
|
||||
collection.replace("123456 ", {});
|
||||
internal.db._replace("123456 ", {});
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
|
|
|
@ -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
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue