From ad3f2d8f2da2020df6ae2dc78dfd9816c9c226cf Mon Sep 17 00:00:00 2001 From: Bruce Baranowski <92940816+bruce-b-molecula@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:59:00 -0400 Subject: [PATCH] fb-2040 (#2354) *InbuiltFunctionsset tests --- sql3/test/defs/defs_set_functions.go | 68 ++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/sql3/test/defs/defs_set_functions.go b/sql3/test/defs/defs_set_functions.go index aa0d7edde..fa6c61fe8 100644 --- a/sql3/test/defs/defs_set_functions.go +++ b/sql3/test/defs/defs_set_functions.go @@ -36,6 +36,40 @@ var setLiteralTests = TableTest{ ), Compare: CompareExactUnordered, }, + { + // SetContainsAllSelectList + name: "set-contains-all-select-list", + SQLs: sqls( + "select _id, setcontainsall(event, ['POST']) from selectwithsetliterals", + ), + ExpHdrs: hdrs( + hdr("_id", fldTypeID), + hdr("", fldTypeBool), + ), + ExpRows: rows( + row(int64(1), true), + row(int64(2), false), + row(int64(3), true), + ), + Compare: CompareExactUnordered, + }, + { + // SetContainsAnySelectList + name: "set-contains-any-select-list", + SQLs: sqls( + "select _id, setcontainsany(event, ['POST', 'DELETE']) from selectwithsetliterals", + ), + ExpHdrs: hdrs( + hdr("_id", fldTypeID), + hdr("", fldTypeBool), + ), + ExpRows: rows( + row(int64(1), true), + row(int64(2), false), + row(int64(3), true), + ), + Compare: CompareExactUnordered, + }, { // SetContainsSelectListInt name: "set-contains-select-list-int", @@ -53,6 +87,40 @@ var setLiteralTests = TableTest{ ), Compare: CompareExactUnordered, }, + { + // SetContainsSelectAllListInt + name: "set-contains-select-all-list-int", + SQLs: sqls( + "select _id, setcontainsall(ievent, [101]) from selectwithsetliterals", + ), + ExpHdrs: hdrs( + hdr("_id", fldTypeID), + hdr("", fldTypeBool), + ), + ExpRows: rows( + row(int64(1), nil), + row(int64(2), nil), + row(int64(3), true), + ), + Compare: CompareExactUnordered, + }, + { + // SetContainsSelectAnyListInt + name: "set-contains-select-any-list-int", + SQLs: sqls( + "select _id, setcontainsany(ievent, [100, 101, 102]) from selectwithsetliterals", + ), + ExpHdrs: hdrs( + hdr("_id", fldTypeID), + hdr("", fldTypeBool), + ), + ExpRows: rows( + row(int64(1), nil), + row(int64(2), nil), + row(int64(3), true), + ), + Compare: CompareExactUnordered, + }, { // SetContainsWithLiteral // SetContainsWithLiteralInt