From 69fc6e1662a0dd08045ee67900c939bab2d6607c Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Fri, 8 Mar 2013 14:38:08 +0100 Subject: [PATCH] added test case --- js/common/tests/shell-document.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/common/tests/shell-document.js b/js/common/tests/shell-document.js index 6954184bea..68c6412f6e 100644 --- a/js/common/tests/shell-document.js +++ b/js/common/tests/shell-document.js @@ -215,6 +215,22 @@ function CollectionDocumentSuite () { wait(0.0); }, +//////////////////////////////////////////////////////////////////////////////// +/// @brief create a document w/ invalid primary key data types +//////////////////////////////////////////////////////////////////////////////// + + testSaveInvalidDocumentKeyType : function () { + [ 1, 2, 3, false, true, null, [ ], { } ].forEach(function (key) { + try { + collection.save({ _key: key }); + fail(); + } + catch (err) { + assertEqual(ERRORS.ERROR_ARANGO_DOCUMENT_KEY_BAD.code, err.errorNum); + } + }); + }, + //////////////////////////////////////////////////////////////////////////////// /// @brief create a document w/ primary key violation ////////////////////////////////////////////////////////////////////////////////