From d1f18edd3e452469b760b34acf89403594c1ddc7 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Oct 2022 07:51:33 -0700 Subject: [PATCH] updated unit and functional tests --- src/Parsers/tests/KQL/gtest_KQL_dynamicFunctions.cpp | 8 ++++++++ .../queries/0_stateless/02366_kql_func_dynamic.reference | 1 + tests/queries/0_stateless/02366_kql_func_dynamic.sql | 1 + 3 files changed, 10 insertions(+) diff --git a/src/Parsers/tests/KQL/gtest_KQL_dynamicFunctions.cpp b/src/Parsers/tests/KQL/gtest_KQL_dynamicFunctions.cpp index 13e995dc3e9..24bd92cb143 100644 --- a/src/Parsers/tests/KQL/gtest_KQL_dynamicFunctions.cpp +++ b/src/Parsers/tests/KQL/gtest_KQL_dynamicFunctions.cpp @@ -156,5 +156,13 @@ INSTANTIATE_TEST_SUITE_P(ParserKQLQuery_Dynamic, ParserTest, { "print strlen(A[0])", "SELECT lengthUTF8(A[if(0 >= 0, 0 + 1, 0)])" + }, + { + "print repeat(1, 3)", + "SELECT if(3 < 0, [NULL], arrayWithConstant(abs(3), 1))" + }, + { + "print repeat(1, -3)", + "SELECT if(-3 < 0, [NULL], arrayWithConstant(abs(-3), 1))" } }))); diff --git a/tests/queries/0_stateless/02366_kql_func_dynamic.reference b/tests/queries/0_stateless/02366_kql_func_dynamic.reference index cb160ab9d19..d262b9d0610 100644 --- a/tests/queries/0_stateless/02366_kql_func_dynamic.reference +++ b/tests/queries/0_stateless/02366_kql_func_dynamic.reference @@ -106,6 +106,7 @@ nan ['asd','asd','asd'] [86400,86400,86400] [true,true,true] +[NULL] -- set_difference() [] [] diff --git a/tests/queries/0_stateless/02366_kql_func_dynamic.sql b/tests/queries/0_stateless/02366_kql_func_dynamic.sql index d2ffb5ac869..283e52f8562 100644 --- a/tests/queries/0_stateless/02366_kql_func_dynamic.sql +++ b/tests/queries/0_stateless/02366_kql_func_dynamic.sql @@ -108,6 +108,7 @@ print repeat(1, 3); print repeat("asd", 3); print repeat(timespan(1d), 3); print repeat(true, 3); +print repeat(1, -3); print '-- set_difference()'; print set_difference(dynamic([]), dynamic([])); print set_difference(dynamic([]), dynamic([9]));