1
0
Fork 0

Merged conflict

This commit is contained in:
Michael Hackstein 2013-01-14 01:21:00 +01:00
commit 1fae3deaa8
3 changed files with 56 additions and 12 deletions

View File

@ -85,10 +85,6 @@ ArangoStatement.prototype.bind = function (key, value) {
this._bindVars = key; this._bindVars = key;
} }
else if (typeof(key) === "string") { else if (typeof(key) === "string") {
if (this._bindVars[key] !== undefined) {
throw "redeclaration of bind parameter";
}
this._bindVars[key] = value; this._bindVars[key] = value;
} }
else if (typeof(key) === "number") { else if (typeof(key) === "number") {
@ -98,10 +94,6 @@ ArangoStatement.prototype.bind = function (key, value) {
throw "invalid bind parameter declaration"; throw "invalid bind parameter declaration";
} }
if (this._bindVars[strKey] !== undefined) {
throw "redeclaration of bind parameter";
}
this._bindVars[strKey] = value; this._bindVars[strKey] = value;
} }
else { else {

View File

@ -69,9 +69,23 @@ function CollectionDocumentSuiteErrorHandling () {
/// @brief bad handle /// @brief bad handle
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
testErrorHandlingBadHandle : function () { testErrorHandlingBadHandleDatabase : function () {
try { 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(); fail();
} }
catch (err) { catch (err) {
@ -85,7 +99,7 @@ function CollectionDocumentSuiteErrorHandling () {
testErrorHandlingBadHandleReplace : function () { testErrorHandlingBadHandleReplace : function () {
try { try {
collection.replace("123456 ", {}); internal.db._replace("123456 ", {});
fail(); fail();
} }
catch (err) { catch (err) {

View File

@ -334,7 +334,7 @@ function ahuacatlQueryTraverseTestSuite () {
/// @brief test max-depth filtering /// @brief test max-depth filtering
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
testTraversalDepthFirstMax : function () { testTraversalDepthFirstMax1 : function () {
var config = { var config = {
strategy: "depthfirst", strategy: "depthfirst",
order: "preorder", order: "preorder",
@ -348,6 +348,24 @@ function ahuacatlQueryTraverseTestSuite () {
assertEqual([ "A", "B", "C", "D", "C" ], actual); 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 /// @brief test max-depth filtering
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@ -368,6 +386,26 @@ function ahuacatlQueryTraverseTestSuite () {
assertEqual([ "A", "B", "C", "D" ], actual); 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 /// @brief test max-depth filtering
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////