/*jshint globalstrict:false, strict:false, maxlen: 500 */ /*global assertEqual, fail */ //////////////////////////////////////////////////////////////////////////////// /// @brief tests for query language, bind parameters /// /// @file /// /// DISCLAIMER /// /// Copyright 2019 triagens GmbH, Cologne, Germany /// /// Licensed under the Apache License, Version 2.0 (the "License"); /// you may not use this file except in compliance with the License. /// You may obtain a copy of the License at /// /// http://www.apache.org/licenses/LICENSE-2.0 /// /// Unless required by applicable law or agreed to in writing, software /// distributed under the License is distributed on an "AS IS" BASIS, /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /// See the License for the specific language governing permissions and /// limitations under the License. /// /// Copyright holder is triAGENS GmbH, Cologne, Germany /// /// @author Jan Christoph Uhde /// @author Copyright 2019, triAGENS GmbH, Cologne, Germany //////////////////////////////////////////////////////////////////////////////// const jsunity = require("jsunity"); const internal = require("internal"); //////////////////////////////////////////////////////////////////////////////// /// @brief test suite //////////////////////////////////////////////////////////////////////////////// function aqlOptionsTestSuite () { var errors = internal.errors; return { //////////////////////////////////////////////////////////////////////////////// /// @brief test maxRuntime option //////////////////////////////////////////////////////////////////////////////// testMaxRuntime : function () { try { internal.db._query("LET x = SLEEP(10) RETURN 1", {} /*bind*/, { maxRuntime : 1} /*options*/); fail(); } catch (e) { assertEqual(e.errorNum, errors.ERROR_QUERY_KILLED.code); } }, }; } //////////////////////////////////////////////////////////////////////////////// /// @brief executes the test suite //////////////////////////////////////////////////////////////////////////////// jsunity.run(aqlOptionsTestSuite); return jsunity.done();