From 84abf3743501c8a5e65a91c1949069baff88c0b9 Mon Sep 17 00:00:00 2001 From: KVS85 Date: Wed, 20 Mar 2019 17:56:40 +0300 Subject: [PATCH] Add testTemplateStringBuilderEmptyInlines test for https://github.com/arangodb/arangodb/pull/8141 (#8206) --- tests/js/common/shell/shell-statement.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/js/common/shell/shell-statement.js b/tests/js/common/shell/shell-statement.js index 283d232a36..42fe5df05b 100644 --- a/tests/js/common/shell/shell-statement.js +++ b/tests/js/common/shell/shell-statement.js @@ -996,6 +996,17 @@ function StatementSuite () { assertEqual({ value0: [ 1, 2, 3, 4 ], value1: { foo: "bar", baz: "bark" } }, result.bindVars); }, +//////////////////////////////////////////////////////////////////////////////// +/// @brief test string builder +//////////////////////////////////////////////////////////////////////////////// + + testTemplateStringBuilderEmptyInlines : function () { + var foo = "foo-matic", bar = "BAR o MATIC", what = "' this string \\ \" is ' evil\n`"; + var result = aql`FOR ${foo} ${aql.join([])} IN ${bar} ${aql``} RETURN ${what} ${aql.literal('')}`; + assertEqual("FOR @value0 IN @value1 RETURN @value2 ", result.query); + assertEqual({ value0: foo, value1: bar, value2: what }, result.bindVars); + }, + //////////////////////////////////////////////////////////////////////////////// /// @brief test string builder ////////////////////////////////////////////////////////////////////////////////